Answers for "laravel gates"

PHP
1

laravel gates

// in AuthServiceProvider's boot method

Gate::define('update-post', function (User $user, Post $post) {
  return $user->id === $post->user_id;
});
Posted by: Guest on June-14-2021

Browse Popular Code Answers by Language