for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Spatie\Permission\Exceptions;
use Symfony\Component\HttpKernel\Exception\HttpException;
class UnauthorizedException extends HttpException
{
public static function forRoles(array $roles): self
$roles
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
return new static(403, 'User does not have the right roles.', null, []);
}
public static function forPermissions(array $permissions): self
$permissions
return new static(403, 'User does not have the right permissions.', null, []);
public static function notLoggedIn(): self
return new static(403, 'User is not logged in.', null, []);
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.