lundi 7 août 2017

Laravel 5.4 function index try using function show

I have route:

Route::resource('admin/question', 'QuestionsController');

and function index:

public function index() {

  return "Hello";

}

But when I try used index Laravel returned me the error:

Method [show] does not exist.

I'm using the link:

http://localhost:8012/siwz/siwz/public/admin/question

The server is WampServer program. I can only use index function when I change route file:

Route::get('admin/question/index', 'QuestionsController@index');
Route::resource('admin/question', 'QuestionsController');

In Laravel version 5.3 I did not have to do it, it was enough to use:

Route::resource('.../...', '...Controller');



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire