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

Repository Service Bundle Laravel Package

docteurklein/repository-service-bundle

View on GitHub
Deep Wiki
Context7

RepositoryServiceBundle

What ?

A symfony bundle that eases creation of doctrine ORM repositories as services.

It will create a service for each registered entity in the default entity manager.

If you provide a repository tag for a service, it will automatically create an alias and configure doctrine to make it the custom repository class of the associated entity (specified by the for attribute).

How ?

install

composer require docteurklein/repository-service-bundle

register the bundle


    public function registerBundles()
    {
        $bundles = [
            new \DocteurKlein\RepositoryServiceBundle,
            // …
        ];

        return $bundles;
    }

Examples

Note: The following examples use JmsDiExtraBundle to simplify code.

Given an entity:

namespace Model;

/** @ORM\Entity */
class Product
{
    /** @ORM\Id */
    private $id;
}

And the following service:

namespace Repository;

/**
 * @Service("products")
 * @Tag("repository", attributes={"for"="Model\Product"})
 */
final class Products extends EntityRepository
{
}

Then the DIC contains a factory service named repo.model_product for the repository (using ManagerRegistry::getRepository()).

It also contains an alias named products pointing to the repo.model_product service.

The custom repository class is automatically configured to point to Repository\\Products.

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.
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
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope