Replies: 1 comment 2 replies
-
Try to make a PR public static function forRoles(array $roles): self
{
$message = __('User does not have the right roles.');
if (config('permission.display_role_in_exception')) {
$message .= ' '.__('Necessary roles are').' '.implode(', ', $roles);
}
$exception = new static(403, $message, null, []);
$exception->requiredRoles = $roles;
return $exception;
} but in that case it should be added for all exception messages |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to replace messages?
Maybe it can be done like this?
$message = __('User does not have the right roles.');
Beta Was this translation helpful? Give feedback.
All reactions