Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding data column to personalAccessToken table #520

Closed
wants to merge 2 commits into from

Conversation

Mohamadalani963
Copy link

@Mohamadalani963 Mohamadalani963 commented Jun 14, 2024

This pull request introduces a new data column to the personal_access_tokens table in Laravel Sanctum. The data column is intended to store additional JSON-encoded information related to personal access tokens.
Changes

  1. Migration: Added data column in 2019_12_14_000001_create_personal_access_tokens_table.php.
  2. Model: Updated PersonalAccessToken.php to include data in $fillable and cast it to JSON.
  3. Token Creation: Modified HasApiTokens.php and Contracts/HasApiTokens.php to accept data in createToken method.
  4. Testing: Updated HasApiTokensTest.php to include tests for data attribute.
  5. Factory: Added data attribute in PersonalAccessTokenFactory.php.

Impact

This change allows developers to store additional metadata with personal access tokens, enhancing the flexibility and functionality of token management in Laravel Sanctum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant