gpt4 book ai didi

php - 站点移动后,Laravel Controller不存在。在 Vagrant /宅基地工作

转载 作者:行者123 更新时间:2023-12-03 07:49:49 24 4
gpt4 key购买 nike

我正在Laravel网站上工作。我一直在本地与Homestead/Vagrant一​​起工作,并且该网站运行良好。我刚刚将网站移至:http://goferapp.io

在新的实时站点(仍在开发中)中,出现以下错误屏幕:

enter image description here

我已确保在 Controller 中使用正确的 namespace :

    <?php

namespace App\Http\Controllers\Landlord;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use Session;
use Sentinel;
use App\Property;
use App\Tenant;
use App\WaitingList;
use App\ServiceRequest;
use App\Document;
use App\User;
use Mail;
use Carbon;

class LandlordController extends Controller...

在我的路线文件中,我有:
Route::get('/dashboard', ['middleware' => 'postlog', 'uses' => 'LandLord\LandlordController@index']);

这是我的文件夹结构:

enter image description here

我无法弄清楚为什么它在我的本地环境中可以完美工作并且无法正常工作。我用特殊功能清除了缓存:
Route::get('/clear-cache', function() {
$exitCode = Artisan::call('cache:clear');
return 'cache cleared!';
});

我现在很茫然如何使它工作。任何帮助表示赞赏。

最佳答案

问题应该出在文件夹/文件名上。在 route

  Route::get('/dashboard', ['middleware' => 'postlog', 'uses' => 'LandLord\LandlordController@index']);

看到 uses
'uses' => 'LandLord\LandlordController@index']);

更改为
 'uses' => 'Landlord\LandlordController@index']);

LandLordLandlord。有些服务器并不那么宽容。 :-)

另外,运行 composer dump-autoload

关于php - 站点移动后,Laravel Controller不存在。在 Vagrant /宅基地工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36829694/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com