同时遵循链接中给出的步骤
我面临一个错误
[ReflectionException] Class App\Http\Controllers\postsController does not exist 当我运行命令时(在嵌套的参考资料中提到:参考链接)
php artisan route:list我的route.php文件
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', 'WelcomeController@index');
Route::get('contact','WelcomeController@contact');
/*Route::get('home', 'HomeController@index');
Route::controllers([
'auth' => 'Auth\AuthController',
'password' => 'Auth\PasswordController',
]);*/
Route::resource('posts', 'postsController');文件夹结构
(以职位代替项目和任务)
(跳过数据库种子)
发布于 2015-05-10 16:48:04
您在文件名上出错了。
您的控制器名为postsController
Route::resource('posts', 'postsController');但是文件夹结构中的文件是postscontroller,请确保将其重命名为postsController。
https://stackoverflow.com/questions/30153214
复制相似问题