Problems with auth :: routes

4

I am having problem with Auth::routes() I use the framework Laravel in version 5.2 my route file is like this:

Route::singularResourceParameters();
Auth::routes();

Route::group(['middleware' => ['cors']], function (){
  Route::resource('clientes', 'ClienteController');
  Route::resource('categorias', 'CategoriaController');
  Route::resource('embalagens', 'EmbalagemController');
  Route::resource('tipo_produtos', 'TipoProdutoController');
  Route::resource('subcategorias', 'SubCategoriaController');
  Route::resource('produtos', 'ProdutoController');
  Route::resource('loteproduto', 'LoteProdutoController');
});

Route::get('/', [
  'uses' => 'Dashboard@index',
  'as' => 'dashboard.index'
]);

And in my controllers I added this constructor:

public function __construct()
{
    $this->middleware('auth');
}
  

When I try to enter a page, this error occurs:   call_user_func_array () expects parameter 1 to be a valid callback, class 'Illuminate \ Auth \ SessionGuard' does not have a method 'routes'

What can this be?

    
asked by anonymous 24.10.2016 / 14:47

1 answer

3

I found the problem, what happens is that I have worked with the framework of several versions for this reason I made a mess when using the command.

in 5.3 is:

Auth::routes();

Already in the 5.2 version that is the question looks like this:

Route::auth();

Solving my problem.

    
24.10.2016 / 14:52