Skip to content

Commit e7c177d

Browse files
authored
Update README.md
1 parent a5a6285 commit e7c177d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,18 @@ Route::name('api.resource::fetch')
8888
```
8989

9090

91+
## Leveraging the ApiKey name as a foreign key
92+
93+
It stands to reason that in many cases one API key will be issued for exactly one user.
94+
But to enforce referential integrity a join would be required at run time. This is certainly
95+
possible, but it would complicate this repository. So, it is recommended that if you need to
96+
associate a user to an ApiKey you do so by naming the ApiKey the primary key of the user.
97+
You can then join the two entities using an `ON` statement.
98+
99+
The ApiKey name column is unique and indexed and perfectly suited for this approach.
100+
101+
102+
91103
## Event Logging
92104

93105
Admin events are logged when an ApiKey is generated, activated, deactivated, add a scope, and remove a scope.

0 commit comments

Comments
 (0)