Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Route::controller() alternative in Laravel 5.3+

Tags:

People also ask

What is route :: has in Laravel?

It just checks if the given route name is a registered route. For example... Route::get('login', function() { // ... })- >name('login');

How many types of routes are there in Laravel?

Route Parameters Laravel provides two ways of capturing the passed parameter: Required parameter. Optional Parameter.


I just upgraded from Laravel 5.2 to 5.3. I am using Laravel-DataTables package for several tables in my application.

After upgrade when I run artisan serve I'm receiving:

[BadMethodCallException]
Method controller does not exist.

I've tracked the issue down to this piece of code in my routes.php (now web.php)

Route::controller('datatables', 'ProfileController', [
    'anyOrders'  => 'datatables.dataOrders',
    'anyProperties' => 'datatables.dataProperties',
]);

This is the suggested way to route the queries for DataTables Documentation.

Was the Route::controller() deprecated, and what is the alternative to for these routes?