Route::controller('article','ArticleController') Method controller does not exist. , gives an error Method controller does not exist.

The controller created through artisan php artisan make:controller ArticleController

Controller code:

 namespace App\Http\Controllers; use App\Http\Controllers\Controller; use Illuminate\Http\Request; class ArticleController extends Controller { // маршрут соответствует site.ru/article function getIndex() { $hello="Hello world!!"; return view('mainpage',['hello'=>$hello]); } //маршрут соответствует site.ru/article/show function getShow() { $article='Моя статья'; return view('article.show',['article'=>$article]); } // это POST запрос по адресу site.ru/article/save function postSave(Request $request) { //здесь сохраняем статью } } 

What did I miss?

    1 answer 1

    The documentation for the upgrade to Laravel 5.2 was a warning:

    The following features are deprecated in 5.2 and will be removed in June 2011:

    • Implicit controller routes using Route::controller have been deprecated. Please log in to your routes file. This will likely be taken into a package.

    Those. marked obsolete and removed in 5.3. Write routes explicitly.

    • Many thanks, I will be more attentive! - Yohan