AttributeIlluminate\Container\Attributes\Cache
#[Cache]
Attribute to cache the result of a parameter.
Available since
Laravel 13.0
Targets
parameter
Parameters
$storeUnitEnum|string|nullCache store to use.
Practical usage
use Illuminate\Container\Attributes\Cache;
class ReportsController {
public function __invoke(#[Cache('redis')] mixed $data): array {
return ['status' => 'ok'];
}
}