Draft
Conversation
dododedodonl
requested changes
Sep 4, 2025
|
|
||
| ```php | ||
| use DutchCodingCompany\FilamentDeveloperLogins\FilamentDeveloperLoginsPlugin; | ||
| use Illuminate\Database\Eloquent\Builder;; |
Member
There was a problem hiding this comment.
Suggested change
| use Illuminate\Database\Eloquent\Builder;; | |
| use Illuminate\Database\Eloquent\Builder; |
|
|
||
| ### Override query | ||
|
|
||
| Default the plugin will retrieve the user by searching the provided model using the specified column. If you want to implement your own logic to retrieve the user, you can use the `modelCallback()` method. |
Member
There was a problem hiding this comment.
Suggested change
| Default the plugin will retrieve the user by searching the provided model using the specified column. If you want to implement your own logic to retrieve the user, you can use the `modelCallback()` method. | |
| By default the plugin will retrieve the user by searching the provided model using the specified column. If you want to implement your own logic to retrieve the user, you can use the `modelCallback()` method. |
| ### Override query | ||
|
|
||
| Default the plugin will retrieve the user by searching the provided model using the specified column. If you want to implement your own logic to retrieve the user, you can use the `modelCallback()` method. | ||
| This method accepts a closure and provides the plugin and should return an instance of `Illuminate\Database\Eloquent\Builder`. |
Member
There was a problem hiding this comment.
Suggested change
| This method accepts a closure and provides the plugin and should return an instance of `Illuminate\Database\Eloquent\Builder`. | |
| This method accepts a closure. The closure should return an instance of `Illuminate\Database\Eloquent\Builder`. |
| * @param string $credentials | ||
| * @return Builder<\Illuminate\Database\Eloquent\Model&\Illuminate\Contracts\Auth\Authenticatable> | ||
| */ | ||
| public function getModelCallback(self $plugin, string $credentials): Builder |
Member
There was a problem hiding this comment.
This doesn't get the model callback, but the user query builder (via the model callback)
Comment on lines
+117
to
+119
| value: $this->modelCallback | ||
| ?? static fn (): Builder => (new ($plugin->getModelClass())) | ||
| ->where($plugin->getColumn(), $credentials), |
Member
There was a problem hiding this comment.
value: $this->modelCallback
?? static fn (self $plugin, string $credentials): Builder => (new ($plugin->getModelClass()))->where($plugin->getColumn(), $credentials),
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As discussed in #27.
This feature adds the option to override the default behavior of retrieving users from the database. For example, when using scopes that need to be removed when switching users.