master

laravel/framework

Last updated at: 29/12/2023 09:20

Authorizable.php

TLDR

This file contains the definition of the Authorizable interface, which declares a single method can(). This method is used to determine if the entity has a given ability.

Methods

can

Determines if the entity has a given ability.

  • Parameters:
    • $abilities: An iterable or a string representing the abilities to check.
    • $arguments: An array or any other type of data used as arguments for the abilities check. Default value is an empty array.
  • Returns:
    • true if the entity has the ability, false otherwise.
<?php

namespace Illuminate\Contracts\Auth\Access;

interface Authorizable
{
    /**
     * Determine if the entity has a given ability.
     *
     * @param  iterable|string  $abilities
     * @param  array|mixed  $arguments
     * @return bool
     */
    public function can($abilities, $arguments = []);
}