src/AuthTraits/OAuthTrait.php
public function createClientWithScopes($id, $secret, array $scopes)
	{
		$client         = $this->oauthClientClass(true);
		$client->id     = $id;
		$client->secret = $secret;
		$client->name   = $id;
		$client->save();

		$apply_scopes = [];
		foreach ($scopes as $scope) {
			$apply_scopes[] = [
				'client_id' => $id,
				'scope_id'  => $scope,
			];
		}

		DB::table('oauth_client_scopes')->insert($apply_scopes);

		return $client;
	}
public function createClientWithScopes($id, $secret, array $scopes)
	{
		$client         = $this->oauthClientClass(true);
		$client->id     = $id;
		$client->secret = $secret;
		$client->name   = $id;
		$client->save();

		$apply_scopes = [];
		foreach ($scopes as $scope) {
			$apply_scopes[] = [
				'client_id' => $id,
				'scope_id'  => $scope,
			];
		}

		DB::table('oauth_client_scopes')->insert($apply_scopes);

		return $client;
	}
public function createClientWithScopes ( $ id , $ secret , array $ scopes ) { $ client = $ this -> oauthClientClass ( true ) ; $ client -> id = $ id ; $ client -> secret = $ secret ; $ client -> name = $ id ; $ client -> save ( ) ; $ apply_scopes = [ ] ; foreach ( $ scopes as $ scope ) { $ apply_scopes [ ] = [ 'client_id' => $ id , 'scope_id' => $ scope , ] ; } DB :: table ( 'oauth_client_scopes' ) -> insert ( $ apply_scopes ) ; return $ client ; }
Create a client and give it some scopes

@param string $id
@param string $secret
@param array  $scopes

@return object
Create a client and give it some scopes