Add filament resource for tokens; Ignore non-personal tokens in API token endpoints

This commit is contained in:
Constantin Graf
2025-02-11 15:58:25 -05:00
committed by Constantin Graf
parent 69a8c8bb2b
commit ae76135373
10 changed files with 461 additions and 9 deletions

View File

@@ -6,6 +6,7 @@ namespace App\Models\Passport;
use Database\Factories\Passport\TokenFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Carbon;
use Laravel\Passport\Token as PassportToken;
@@ -24,4 +25,14 @@ class Token extends PassportToken
{
/** @use HasFactory<TokenFactory> */
use HasFactory;
/**
* Get the client that the token belongs to.
*
* @return BelongsTo<Client, Token>
*/
public function client(): BelongsTo
{
return $this->belongsTo(Client::class, 'client_id', 'id');
}
}