पेज · Laravilt
API Tokens
Let users create and revoke Sanctum personal access tokens.
->apiTokens() adds an API tokens page (Laravilt\Auth\Pages\Profile\ManageApiTokens). There, users can:
- create a token with a name and a set of abilities (the plain-text token is shown once),
- delete individual tokens,
- revoke all tokens after confirming their password.
php
Tokens are Laravel Sanctum personal access tokens. The LaraviltUser trait already includes HasApiTokens, and the auth migrations create personal_access_tokens if it doesn't exist.
Routes
text
Using a token
Send the token as a bearer token to any route protected by auth:sanctum:
bash
Check abilities in your code with Sanctum's API:
php