We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d9227de commit f3d096dCopy full SHA for f3d096d
src/ClientRepository.php
@@ -2,6 +2,8 @@
2
3
namespace Laravel\Passport;
4
5
+use RuntimeException;
6
+
7
class ClientRepository
8
{
9
/**
@@ -77,6 +79,7 @@ public function activeForUser($userId)
77
79
* Get the personal access token client for the application.
78
80
*
81
* @return \Laravel\Passport\Client
82
+ * @throws RuntimeException
83
*/
84
public function personalAccessClient()
85
@@ -86,6 +89,10 @@ public function personalAccessClient()
86
89
87
90
$client = Passport::personalAccessClient();
88
91
92
+ if (! $client->exists()) {
93
+ throw new RuntimeException('Personal access client not found. Please create one first.');
94
+ }
95
96
return $client->orderBy($client->getKeyName(), 'desc')->first()->client;
97
}
98
0 commit comments