Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Cache Bundle Laravel Package

bash/cache-bundle

View on GitHub
Deep Wiki
Context7

BashRedis Documentation

Step 1

# /config/packages/bash_cache.yaml
bash_cache:
  clients:
    main:
      $options:
        prefix: sportal
        expires:
          short: 60
      $parameters:
          dsn: tcp://127.0.0.1
          port: 6379
          database: 0
          timeout: 3
    counter:
      $options:
        persistent: counters
        prefix: sportal
        expires:
          long: 60
      $parameters:
        dsn: tcp://127.0.0.1
        port: 6379
        database: 1
        timeout: 3
    storage:
      $options:
        prefix: storage
        expires:
          long: 3600
      $parameters:
        dsn: tcp://127.0.0.1
        port: 6379
        database: 2
        timeout: 3

Step 2

# /config/service.yaml
    Bash\Bundle\CacheBundle\BashRedis\Client $mainRedis: '[@bash_cache](https://github.com/bash_cache).main'
    Bash\Bundle\CacheBundle\BashRedis\Client $counterRedis: '[@bash_cache](https://github.com/bash_cache).counter'

or

class IndexController extends AbstractController
{
    /**
     * [@Route](https://github.com/Route)("/",priority=100, methods="GET", name="homepage")
     */
    public function __invoke(ContainerInterface $container): Response
    {
        dump($container->get('bash_cache.main'));
        dump($container->get('bash_cache.counter'));
        dump($container->get('bash_cache.storage'));

        $number = rand(0, 100);

        return new Response(
            '<html><body>'.$number.'</body></html>'
        );
    }
}
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours