morimorim / laravel-cache-attr
Attribute for cache
0.0.4
2024-06-05 13:06 UTC
Requires
- php: >=8.2
- eftec/bladeone: ^4.9
- illuminate/support: ^9|^10|^11
- ray/aop: ^2
Requires (Dev)
- phpunit/phpunit: ^10.4
README
This is package of attributes for Laravel. Supported attributes are here.
See also example.
Install
composer require morimorim/laravel-cache-attr
Usage
Specify attributes like following.
use Laravel\Cache\Attribute\Cacheable; class ExampleService { #[Cacheable(name: 'ExampleService#heavyProcess', ttl_seconds: 60)] public function heavyProcess(int $sleep) { sleep($sleep); return Carbon::now(); } }