Skip to content

viewAny = false policy overrides view #13157

Answered by leandrocfe
bilogic asked this question in Help
Discussion options

You must be logged in to vote

You could use Laravel Scopes to show records by user

public function apply(Builder $builder, Model $model): void
{
    $user = auth()->user();
    $builder->whereUserId($user->id);
}

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@bilogic
Comment options

@leandrocfe
Comment options

@bilogic
Comment options

@leandrocfe
Comment options

@bilogic
Comment options

Answer selected by bilogic
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
4 participants