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

Symfony Aware Laravel Package

adtechpotok/symfony-aware

Symfony “aware” interfaces and traits for quickly injecting common services (EntityManager, Doctrine, cache, logger, kernel, request stack, etc.) into your classes. Works with explicit service calls or Symfony 3.3+ autowiring.

View on GitHub
Deep Wiki
Context7

Build Status License

Aware

Пример использования

Сервис
<?php

use Adtechpotok\Aware\Interfaces\EntityManagerAwareInterface;
use Adtechpotok\Aware\Traits\EntityManagerAwareTrait;

class SomeClass implements EntityManagerAwareInterface
{
    use EntityManagerAwareTrait;
    
    public function someMethod()
    {
        dump($this->em); // $em - дефолтный EntityManager, аналог '@doctrine.orm.default_entity_manager'
    }
}
Объявление сервиса
services:
    some.service:
        class: SomeClass
        calls:
            - {method: setEntityManager, arguments: ['@doctrine.orm.default_entity_manager']}
Таблица соответствий
Aware Service
ConnectionAware @doctrine.dbal.default_connection
CacheAware @cache.app
ContainerAware @service_container
DoctrineAware @doctrine
EntityManagerAware @doctrine.orm.default_entity_manager
EventDispatcherAware @debug.event_dispatcher
FilesystemAware @filesystem
FileLocatorAware @file_locator
FileLinkFormatterAware @debug.file_link_formatter
HttpKernelAware @http_kernel
KernelAware @kernel
LoggerAware @monolog.logger
PropertyAccessorAware @property_accessor
ReaderAware @annotations.cached_reader
RequestStackAware @request_stack
StopwatchAware @debug.stopwatch
Объявление сервиса в Symfony >= 3.3
services:
    _defaults:
        autowire: true
        
    some.service:
        class: SomeClass

Важно! При объявлении сервисов, которые требуют использования тэгов - этот способ не подоходит, Symfony игнорирует тэги при autowire.

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.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui