Маршрут Laravel статьи. Магазин не определен - PullRequest
0 голосов
/ 31 октября 2018

У меня есть ArticleController, но метод хранилища не определен. Любой другой метод отображается в route: list. Я попытался удалить контроллер и сделал я снова, но без различий. Я сделал другой контроллер и назвал его TestController, и это работало нормально. Может ли кто-нибудь помочь мне с этим?

ресурсы / виды / create.blade.php

<form method="POST" action="{{ route('articles.store') }}">

приложение / HTTP / Контроллеры / ArticleController.php

public function create()
{
    return view('staff.articles.create');
}

public function store(Request $request)
{
  //Some code here
}

маршруты / web.php

Route::group(['prefix'=>'staff','middleware'=>['role:editor|author']],function()
{
  Route::resource('/articles','ArticleController');
});

php artisan route:list

|        | GET|HEAD  | staff/articles                      | articles.index      | App\Http\Controllers\ArticleController@index                           | web,role:editor|author |
|        | GET|HEAD  | staff/articles/create               | articles.create     | App\Http\Controllers\ArticleController@create                          | web,role:editor|author |
|        | DELETE    | staff/articles/{article}            | articles.destroy    | App\Http\Controllers\ArticleController@destroy                         | web,role:editor|author |
|        | GET|HEAD  | staff/articles/{article}            | articles.show       | App\Http\Controllers\ArticleController@show                            | web,role:editor|author |
|        | PUT|PATCH | staff/articles/{article}            | articles.update     | App\Http\Controllers\ArticleController@update                          | web,role:editor|author |
|        | GET|HEAD  | staff/articles/{article}/edit       | articles.edit       | App\Http\Controllers\ArticleController@edit                            | web,role:editor|author |
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...