// in AuthServiceProvider's boot method Gate::define('update-post', function (User $user, Post $post) { return $user->id === $post->user_id; });