Skip to content

Commit

Permalink
Throw exception if user not found
Browse files Browse the repository at this point in the history
If somehow the user that matches the identity has been deleted, throw
an exception instead of returning a null user.

Resolves #49.
  • Loading branch information
adamwathan committed Mar 23, 2015
1 parent cece734 commit 8f06079
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/UserStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ public function store($user)

public function findByIdentity($identity)
{
return $identity->belongsTo($this->model, 'user_id')->first();
return $identity->belongsTo($this->model, 'user_id')->firstOrFail();
}
}

0 comments on commit 8f06079

Please sign in to comment.