first(); if (!$client) { return null; } return new class($client) implements ClientEntityInterface { use EntityTrait, ClientTrait; private $client; public function __construct($client) { $this->client = $client; $this->setIdentifier($client->client_id); $this->name = $client->name; $this->redirectUri = $client->redirect_uri; } public function isConfidential() { return true; } }; } public function validateClient($clientIdentifier, $clientSecret, $grantType) { $client = OAuthClient::where('client_id', $clientIdentifier) ->where('client_secret', $clientSecret) ->first(); if (!$client) { return false; } return in_array($grantType, $client->grant_types); } }