当我运行命令时:
composer dumpautoload
然后我得到了错误:
Class 'App\Http\Controllers\Controller' not found
文件app / Http / Controllers / controller.php不存在
可能是什么问题?
答案 0 :(得分:0)
在最新的6.x版本中,您缺少Laravel随附的控制器
在app/Http/Controllers
中创建名为Controller.php
的新文件
在此粘贴
<?php
namespace App\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}