Download the PHP package ipunkt/laravel-repositories without Composer

On this page you can find all versions of the php package ipunkt/laravel-repositories. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-repositories

Generic repository implementation for Laravel

Latest Stable Version Latest Unstable Version License Total Downloads

Installation

Add to your composer.json following lines

"require": {
    "ipunkt/laravel-repositories": "~2.0"
}

Usage

Repository Interfaces

Simply extend your interfaces by the provided interface Ipunkt\LaravelRepositories\Contracts\RepositoryInterface.

Example

use Ipunkt\LaravelRepositories\Contracts\RepositoryInterface;

interface HolidayRepository extends RepositoryInterface
{
    public function allByUser(User $user);
}

Repository Classes

Simply extend your repository class by the provided Ipunkt\LaravelRepositories\EloquentRepository. It is an abstract class.

You need to have your own constructor which sets the internal property model to the appropriate model this repository will work on.

Example

use Ipunkt\LaravelRepositories\EloquentRepository;

class EloquentHolidayRepository extends EloquentRepository implements HolidayRepository
{
    /**
     * @param Holiday $holiday eloquent model
     */
    public function __construct(Holiday $holiday)
    {
        $this->model = $holiday;
    }

    /** implementing all methods in HolidayRepository */
}

Registering with an Service Provider

You should register all repository stuff with a service provider to use it for example in a controller.

Example

class RepositoryServiceProvider extends ServiceProvider
{
    public function register()
    {
        //  binding interface HolidayRepository to the concrete implementation of EloquentHolidayRepository
        $this->app->bind(
            'HolidayRepository',
            function () {
                return new EloquentHolidayRepository(new Holiday());
            }
        );
    }
}

class HolidayController extends Controller
{
    private $repo;

    public function __construct(HolidayRepository $holidayRepository)
    {
        $this->repo = $holidayRepository;
    }
}

API Documentation

Please look at the Ipunkt\LaravelRepositories\Contracts\RepositoryInterface for the current existing methods.


All versions of laravel-repositories with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
illuminate/support Version ~4.0||~5.1.0|~5.2.0|~5.3.0
illuminate/database Version ~4.0|~5.1.0|~5.2.0|~5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ipunkt/laravel-repositories contains the following files

Loading the files please wait ...