Laravel framework- Why aren\'t I able to use Auth::user(), (to see if user has been logged in) in the controller of the laravel project. Is the Session not connected to the cont
If you're on Laravel 5.x, you'll probably have the auth middleware component. That might be the missing link.
I often use a pattern like this in my controllers:
public function __construct()
{
$this->middleware('auth');
$this->user = \Auth::user();
}
then you can
if ($this->user .. )
or
if ($this->user->can('something'))
with Entrust or similar