Files
glastree/vendor/spatie/laravel-permission/src/Exceptions/GuardDoesNotMatch.php
T
2026-05-26 08:14:29 +02:00

18 lines
497 B
PHP

<?php
namespace Spatie\Permission\Exceptions;
use Illuminate\Support\Collection;
use InvalidArgumentException;
class GuardDoesNotMatch extends InvalidArgumentException
{
public static function create(string $givenGuard, Collection $expectedGuards): static
{
return new static(__('The given role or permission should use guard `:expected` instead of `:given`.', [
'expected' => $expectedGuards->implode(', '),
'given' => $givenGuard,
]));
}
}