Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel gates

// in AuthServiceProvider's boot method

Gate::define('update-post', function (User $user, Post $post) {
  return $user->id === $post->user_id;
});
 
PREVIOUS NEXT
Tagged: #laravel #gates
ADD COMMENT
Topic
Name
1+2 =