Problems with auth::Routes

Asked

Viewed 103 times

4

I’m having trouble with Auth::routes() use the framework Laravel in the version 5.2 my route archive 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 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 ?

1 answer

3

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

in the version 5.3 is:

Auth::routes();

already in the version 5.2 that is the question is thus:

Route::auth();

Solving my problem.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.