Skip to content

Instantly share code, notes, and snippets.

@nataliaconde
Created May 15, 2023 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nataliaconde/a17cf39500106907aa84613c4a507025 to your computer and use it in GitHub Desktop.
Save nataliaconde/a17cf39500106907aa84613c4a507025 to your computer and use it in GitHub Desktop.
<?php
namespace App\Policies;
use App\Models\Post;
use App\Models\User;
class PostPolicy
{
/**
* Determine if the user can update the post.
*/
public function update(User $user): bool
{
return $user->role == 'admin';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment