Skip to content

Instantly share code, notes, and snippets.

@nataliaconde
Last active May 15, 2023 12:33
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/3498014be52d23de1ed491deba604a1c to your computer and use it in GitHub Desktop.
Save nataliaconde/3498014be52d23de1ed491deba604a1c to your computer and use it in GitHub Desktop.
if (Gate::forUser($user)->allows('can-post', $post)) {
// The user is authorized to update the post…
}
if (Gate::forUser($user)->denies('can-post', $post)) {
// The user cannot update the post…
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment