2017 © Pedro Peláez
 

library laravel-repositories

A base repository class and interface, together with a caching decorator. Extend them for use in your own projects.

image

matthewbdaly/laravel-repositories

A base repository class and interface, together with a caching decorator. Extend them for use in your own projects.

  • Friday, June 8, 2018
  • by matthewbdaly
  • Repository
  • 1 Watchers
  • 4 Stars
  • 577 Installations
  • PHP
  • 5 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 9 Versions
  • 8 % Grown

The README.md

laravel-repositories

Build Status Coverage Status A base repository class and interface, together with a caching decorator. Extend them for use in your own projects., (*1)

The base interface is Matthewbdaly\LaravelRepositories\Repositories\Interfaces\AbstractRepositoryInterface. Your repositories should have interfaces that extend this, to facilitate type-hinting them., (*2)

This interface is implemented by both the abstract decorator Matthewbdaly\LaravelRepositories\Repositories\Decorators\BaseDecorator and the abstract repository Matthewbdaly\LaravelRepositories\Repositories\Base. Again, you should extend these classes to create your own repositories and decorators. You can then resolve these interfaces in your own service provider as follows:, (*3)

<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        //
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        $this->app->singleton('App\Repositories\Interfaces\ExampleRepositoryInterface', function () {
            $baseRepo = new \App\Repositories\EloquentExampleRepository(new \App\Example);
            $cachingRepo = new \App\Repositories\Decorators\ExampleDecorator($baseRepo, $this->app['cache.store']);
            return $cachingRepo;
        });
    }
}

Artisan tasks

This package implements the following Artisan tasks to help writing boilerplate:, (*4)

  • make:repository - Makes a repository for the model passed, ie php artisan make:repository Foo. Pass the --all flag to also create the contract and decorator.
  • make:repository:contract - Makes a contract for the model passed, ie php artisan make:repository:contract Foo
  • make:repository:decorator - Makes a decorator for the model passed, ie php artisan make:repository:decorator Foo

The Versions

08/06 2018

dev-master

9999999-dev

A base repository class and interface, together with a caching decorator. Extend them for use in your own projects.

  Sources   Download

MIT

The Development Requires

laravel cache caching repositories decorators

08/06 2018

1.2.1

1.2.1.0

A base repository class and interface, together with a caching decorator. Extend them for use in your own projects.

  Sources   Download

MIT

The Development Requires

laravel cache caching repositories decorators

08/06 2018

1.2.0

1.2.0.0

A base repository class and interface, together with a caching decorator. Extend them for use in your own projects.

  Sources   Download

MIT

The Development Requires

laravel cache caching repositories decorators

18/03 2018

1.1.2

1.1.2.0

A base repository class and interface, together with a caching decorator. Extend them for use in your own projects.

  Sources   Download

MIT

The Development Requires

laravel cache caching repositories decorators

18/03 2018

1.1.1

1.1.1.0

A base repository class and interface, together with a caching decorator. Extend them for use in your own projects.

  Sources   Download

MIT

The Development Requires

laravel cache caching repositories decorators

06/02 2018

1.1.0

1.1.0.0

A base repository class and interface, together with a caching decorator. Extend them for use in your own projects.

  Sources   Download

MIT

The Development Requires

laravel cache caching repositories decorators

24/11 2017

1.0.2

1.0.2.0

A base repository class and interface, together with a caching decorator. Extend them for use in your own projects.

  Sources   Download

MIT

The Development Requires

laravel cache caching repositories decorators

14/11 2017

1.0.1

1.0.1.0

A base repository class and interface, together with a caching decorator. Extend them for use in your own projects.

  Sources   Download

MIT

The Development Requires

laravel cache caching repositories decorators

14/11 2017

1.0.0

1.0.0.0

A base repository class and interface, together with a caching decorator. Extend them for use in your own projects.

  Sources   Download

MIT

The Development Requires

laravel cache caching repositories decorators