Php 站点移动后,Laravel控制器不存在。流浪者/宅基地上的工程
我在拉威尔的一个网站上工作。我一直在当地与宅地/流浪者一起工作,现场工作正常。我刚刚将网站移至: 在新的实时站点(仍在开发中)上,我看到以下错误屏幕: 我已确保在控制器中使用正确的命名空间:Php 站点移动后,Laravel控制器不存在。流浪者/宅基地上的工程,php,laravel,error-handling,laravel-5,laravel-5.2,Php,Laravel,Error Handling,Laravel 5,Laravel 5.2,我在拉威尔的一个网站上工作。我一直在当地与宅地/流浪者一起工作,现场工作正常。我刚刚将网站移至: 在新的实时站点(仍在开发中)上,我看到以下错误屏幕: 我已确保在控制器中使用正确的命名空间: <?php namespace App\Http\Controllers\Landlord; use Illuminate\Http\Request; use App\Http\Requests; use App\Http\Controllers\Controller; use Ses
<?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('/clear-cache', function() {
$exitCode = Artisan::call('cache:clear');
return 'cache cleared!';
});
我现在不知道如何使它工作。感谢您的帮助。问题在于文件夹/文件名。在你的路线上
Route::get('/dashboard', ['middleware' => 'postlog', 'uses' => 'LandLord\LandlordController@index']);
请参见使用
'uses' => 'LandLord\LandlordController@index']);
换成
'uses' => 'Landlord\LandlordController@index']);
即,房东
至房东
。有些服务器不那么宽容。:-)
另外,运行
composer dump autoload
是否运行了composer dump autoload
?检查文件本身和包含文件夹的权限。我不确定Laravel是否区分大小写,但我确实注意到,在错误消息中,路径是Controllers/lown
,而在文件结构中,路径是Controllers/lown
。我已运行composer dump autoload并检查了权限。也不行。还有其他想法吗?是的,就是这样。谢谢你的帮助。
'uses' => 'Landlord\LandlordController@index']);