Can
class Can implements Rule, ValidatorAwareRule (View source)
Properties
| protected string | $ability | The ability to check. |
|
| protected array | $arguments | The arguments to pass to the authorization check. |
|
| protected Validator | $validator | The current validator instance. |
Methods
__construct(string $ability, array $arguments = [])
Constructor.
bool
passes(string $attribute, mixed $value)
Determine if the validation rule passes.
string|array
message()
Get the validation error message.
$this
Details
__construct(string $ability, array $arguments = [])
Constructor.
bool
passes(string $attribute, mixed $value)
Determine if the validation rule passes.
string|array
message()
Get the validation error message.
$this
setValidator(Validator $validator)
Set the current validator.
Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.