Gerbang dan Kebijakan di Laravel
...
...
Gate::define('update-post', function ($user, $post) {
return $user->id == $post->user_id;
});
...
...
Curious Caiman
...
...
Gate::define('update-post', function ($user, $post) {
return $user->id == $post->user_id;
});
...
...
class PostPolicy
{
public function view(User $user, Post $post) {}
public function create(User $user) {}
public function update(User $user, Post $post) {}
public function delete(User $user, Post $post) {}
}