Skip to content

Instantly share code, notes, and snippets.

@NAKKA-K
Last active June 7, 2019 02:06
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 NAKKA-K/5169b25d95bbe13df215b80d5bdb81ad to your computer and use it in GitHub Desktop.
Save NAKKA-K/5169b25d95bbe13df215b80d5bdb81ad to your computer and use it in GitHub Desktop.
<?php
namespace Illuminate\Auth\Access;
trait HandlesAuthorization
{
/**
* Create a new access response.
*
* @param string|null $message
* @return \Illuminate\Auth\Access\Response
*/
protected function allow($message = null)
{
return new Response($message);
}
/**
* Throws an unauthorized exception.
*
* @param string $message
* @return void
*
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
protected function deny($message = 'This action is unauthorized.')
{
throw new AuthorizationException($message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment