Download the PHP package lerouse/laravel-repository without Composer

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

Laravel Model Repository

Laravel Repository Build Latest Stable Version License Innerbichler UK

Model Repository implementation for the Laravel framework ^v6.0 and above.

This package provides a structured framework to begin implementing a simple Model Repository structure in an existing Laravel application.

Installation

The recommended method to install LaravelRepository is with composer

Laravel without auto-discovery

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php

Package configuration

Copy the package configuration to your local config directory.

Usage

Model Repository Location

By default Laravel Model Repository presumes that model repositories are stored in the directory app/repositories/model. If you would like to change the directory your model repositories are stored change the namespace variable in the config/repostiory.php config file.

For example if your model repositories are located in app/model/repositories update the namespace to

Creating a Repository

Repositories should extend the Lerouse\LaravelRepository\EloquentRepository method and implement the builder method which should return an instance of a Illuminate\Database\Eloquent\Builder.

The following methods are available out of the box:-

Method Return Type Description
Collection Get all Models
LengthAwarePaginator Get all models as Paginated Results
Model Find a Model by its Primary Key
Collection Find a collection of Models by their Primary Keys
Model Create a new Model
Boolean Create a collection of new Models
Model Update a Model by its Primary Key
Boolean Update a collection of Models
Model/null Delete a Model by its Primary Key
void Delete a collection of Models by their Primary Keys

Using a Repository

Repositories can be used directly (see above for available built in methods).

Extending a Repository

Repositories should be the single point for extending/amending queries to your models. The advantage of this is all of your model business logic is in a single location. See below a repository that contains commonly used extended functionality as well as some custom methods that are also used.

Laravel Route Model Binding

Laravel route model binding provides a convenient way to automatically inject the model instances directly into your routes. To force the route model binding to use your repository rather than the model itself you can add the trait to your model.

Now when you utilise Laravel's Route Model Binding, the find method on the repository will be used.

Please Note: The repositories location is determined via the namespace variable in the config/repostiory.php config file.

License

Laravel Model Repository is free software distributed under the terms of the MIT license.


All versions of laravel-repository with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0|^8.1
ext-json Version *
illuminate/contracts Version ^6.0|^7.0|^8.0|^9.0|^10.0
illuminate/events Version ^6.0|^7.0|^8.0|^9.0|^10.0
illuminate/database Version ^6.0|^7.0|^8.0|^9.0|^10.0
illuminate/support Version ^6.0|^7.0|^8.0|^9.0|^10.0
laravel/legacy-factories Version ^1.2
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 lerouse/laravel-repository contains the following files

Loading the files please wait ....