Skip to content
Discussion options

You must be logged in to vote

Currently there is no way. The developer expects a first() equivalent call when dealing with the authenticated user.

You "could" use a Global Scope on the User model, which would be replicated on the UserProvider, but it would affect every query.

The only alternative is to extend the EloquentUserProvider with your own version, and override the newModelQuery() method, where the query gets created from a model class name.

    /**
     * Get a new query builder for the model instance.
     *
     * @param  \Illuminate\Database\Eloquent\Model|null  $model
     * @return \Illuminate\Database\Eloquent\Builder
     */
    protected function newModelQuery($model = null)
    {
        $query = is_…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wsy998
Comment options

Answer selected by wsy998
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants