morimorim/laravel-cache-attr

Attribute for cache

Installs: 117

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/morimorim/laravel-cache-attr

0.0.4 2024-06-05 13:06 UTC

This package is auto-updated.

Last update: 2025-10-05 16:04:30 UTC


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();
    }
}