Download the PHP package dees040/repository without Composer

On this page you can find all versions of the php package dees040/repository. 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 repository

Laravel Repository Package

THIS PACKAGE IS A WORK IN PROGRESS

This packages helps you to easily implement the repository package in your Laravel application.

Why use this package out of the many other Laravel repository package? This package was inspired by multiple other Laravel repository package. I took all the good things from those packages and create one unique package for it. Also I keep maintain this package, because I use it in multiple of my own projects.

Installation

You can install this package using composer, by running the following command:

The service provider is automatically added via Laravel package discovery.

Methods

Dees040\Repository\Contracts\Repository

Usage

Creating a repository

Repositories can be created by hand or via a command provided in this package. If you'd like to create a repository by hand you should create two files for each repository.

One class for the repository contract:

And one class for the actual repository:

The other option is creating the file using the make:repository command:

Usage in controllers

After creating the repository you should bind the repository contract to the correct repository using the Laravel Container. By doing this Laravel knows exactly which repository to use for which contract. This makes it very easy to switch between a eloquent repository or e.g. a MongoDB repository.

So before using any repositories in your controller make sure to bind it to the container. You can do that using the bind($abstract, concrete) method in the Container. E.g.: App::bind(\App\Repositories\Contracts\PostRepository::class, \App\Repositories\PostEloquentRepository::class).

Personally I like to create a new service provider named \App\Providers\RepositoryServiceProvider.php and do something like this:

After binding in to the container you can use dependency injection inside your controller to get the repository.

Using criteria

If you'd like to execute custom queries to the database call you can use criteria. You can add criteria to your call by calling the pushCriteria method.

Make sure that your custom criteria classes are implementing the \Dees040\Repository\Contracts\Criteria interface. An example of custom criteria is:

RequestCriteria

The package ships with a useful criteria out of the box. The RequestCriteria. It gives you the ability to easily perform extra actions on your queries via the route parameters. You can add order by items or search through your models. You can add the criteria by default in the constructor of a repository:

After doing this you can add following query parameters.

If you'd like to have the ability to search you should override the getSearchableFields() method in your repository. All the fields returned in the array of that method are then searchable via the route parameters.

TODOS


All versions of repository with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version 5.5.*|5.6.*|5.7.*|5.8.*|6.*|7.*|8.*
laravel/legacy-factories Version ^1.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 dees040/repository contains the following files

Loading the files please wait ....