public function __construct(UserRepository $users) { // Try to load user by uid stored in session. // If there is no uid stored in session or the uid is invalid // it will return a null value. $this->user = $users->get(session('uid')); }