Official Laravel source
AttributeIlluminate\Container\Attributes\Bind

#[Bind]

Attribute to ensure the parameter is authenticated.

Available since

Laravel 13.0

Targets

class

Parameters

  • $concretestring

    Defines the "concrete" value used by the attribute. Expected type: string.

  • $environmentsstring|array|UnitEnum

    Defines the "environments" value used by the attribute. Expected type: string|array|UnitEnum.

Practical usage

use Illuminate\Container\Attributes\Authenticated;

class ReportsController {
    public function __invoke(#[Authenticated('web')] mixed $user): array {
        return ['status' => 'ok'];
    }
}