简体   繁体   中英

Route::controllers in Laravel 5.3

[BadMethodCallException]

Method controllers does not exist.

Route::controllers(['auth' => 'Auth\AuthController', 'password' => 'Auth\PasswordController',]);

How is in Laravel 5.3?

Thanks

The Route::controller() has been deprecated (notes can be seen in the upgrade from 5.2 -> 5.3 on the docs site )

Implicit controller routes using Route::controller have been deprecated. Please use explicit route registration in your routes file. This will likely be extracted into a package.

Instead you must explicitly list each route in not resourceful controllers like so:

Route::get('foo', 'FooController@foo');

If your question is aimed specifically at the auth routes only then as the comments on your question running php artisan make:auth or adding Auth::routes(); to your routes\\web.php file should do the trick.

May few dependency cannot injected in your project when you install via composer. You can try again to install a new copy or write the following lines in your project directory using the terminal.

composer install

or you can write

composer dump-autoload

Hope you can fix the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM