0👍
✅
Your problem is your route definition:
Route::resource('/article', 'ArticleController');
That needs to be:
Route::resource('article', 'ArticleController');
No leading slash.
When you use Route::resource
you are in fact defining routes for GET
, POST
, PUT
, PATCH
, and DELETE
. It’s directly related to your model Article
.
Update
Change web.php to this:
Route::resource('article', 'ArticleController');
// this is always the last route in the file
Route::get('{path}', function () {
return view('index');
})->where('path', '(.*)');
Source:stackexchange.com