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

Class Meta Bundle Laravel Package

ashleydawson/class-meta-bundle

View on GitHub
Deep Wiki
Context7

Class Meta Bundle

Symfony bundle for my Class Meta library. This allows you to attach arbitrary metadata to classes and their constants via annotation.

Installation

To install via composer, use the following command:

$ composer require ashleydawson/class-meta-bundle

And then add the bundle to the AppKernel#registerBundles() method:

$bundles = [
    // ...
    new AshleyDawson\ClassMetaBundle\AshleyDawsonClassMetaBundle(),
];

Configuration

Configuration allows you to set a cache provider. By default the cache provider is ArrayCache - so in production, I'd advise you change this to a more persistent cache strategy:

# app/config/config.yml

services:
    my_class_meta_cache_provider:
        class: Doctrine\Common\Cache\FilesystemCache
        arguments: [ "%kernel.cache_dir%/ashleydawson/class_meta" ]

ashley_dawson_class_meta:
    cache_provider_service_id: my_class_meta_cache_provider # Cache provider service ID (optional)
    cache_provider_ttl: 300 # 5 minutes TTL (optional)

Note: The cache is invalidated by file modify time, but if you want to also add a TTL (Time-to-live) to the cache it can be done via the cache_provider_ttl parameter.

Note: To disable the cache, simply pass the id of a Doctrine\Common\Cache\VoidCache service.

Basic Usage

To use the meta cache manager service in a controller, simply do:

public function indexAction()
{
    $meta = $this->get('ashleydawson.class_meta')->getClassConstantsMeta('AppBundle\Enum\MyEnum');
    
    dump($meta);
}

For more documentation, please see the full library readme.

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.
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
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium