【发布时间】:2016-11-10 03:50:02
【问题描述】:
当我添加基本路线 (foo) 时会发生这种情况。其余路线按预期工作。这会生成 NotFoundHttpException 和 ModelNotFoundException。
app/Http/routes.php:
Route::auth();
Route::get('/home', 'HomeController@index');
Route::get('/index','WosController@index');
Route::get('/create','WosController@create');
Route::get('/{workorder}','WosController@show');
Route::post('/create','WosController@store');
Route::get('/', function () {
return view('welcome');
});
Route::get('/foo', function () {
return view('foo');
});
app/resources/views/foo.blade.php:
<p>foo</p>
【问题讨论】:
-
尝试改变 WosController@show 声明的顺序。将其作为文件中的最后一条路由。
-
成功了,谢谢!但为什么它起作用了?
-
在 Laravel 5.3 中它位于 Handler.php 文件的第 113 行 ...