I'm using laravel 5.6 along with the AdminLTE . When I login, it is returning the error
ErrorException (E_ERROR) Trying to get property of non-object
Displaying the page.blade.php view, in the
<div class="pull-left info text-center">
<p>{{ Auth::user()->name}}</p>
<p>Crc {{ Auth::user()->crc}}</p>
</div>
I tried to use the auth () -> user () -> name class, but the same problem occurs.
Model Users
class User extends Authenticatable
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email','cpf', 'crc', 'password', 'cep', 'endereco', 'numero',
'bairro', 'cidade',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token', 'cpf', 'crc',
];
}