From 8f06079598edbbaf34ccf28a59f869ad2f85110b Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Mon, 23 Mar 2015 08:46:07 -0400 Subject: [PATCH] Throw exception if user not found If somehow the user that matches the identity has been deleted, throw an exception instead of returning a null user. Resolves #49. --- src/UserStore.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UserStore.php b/src/UserStore.php index f824ef6..fd6e9d5 100644 --- a/src/UserStore.php +++ b/src/UserStore.php @@ -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(); } }