12345678910111213141516171819202122232425262728293031 |
- <?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);
- }
- }
|