0
Property [type] does not exist on this Collection instance.
I am doing a project in Laravel (5.4) where it is practically ready, however, this error is occurring, because I want the user to click to login, do not appear the view \home
and yes enter that if/Else:
public function index()
{
$user = Auth::user();
if($user->tipo == 'Administrador'){
return View('/inicioadm'); //aqui já tentei com redirect e tbm n foi
}else{
return View('/iniciodes'); //aqui já tentei com redirect e tbm n foi
}
}
Routes:
Route::('home', 'Auth\HomeController@index');
Route::post('home', 'Auth\HomeController@index');
In $user->type, type is an attribute of the users table. You created this attribute?
– ericrj
What is this
tipo
? Would not be$user->role
?– Woss