Download the PHP package saritasa/laravel-repositories without Composer

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

Laravel Repositories

PHP Unit PHP CodeSniffer CodeCov Release PHPv Downloads

Implementation of Repository pattern for Laravel (on top of Eloquent)

Laravel 5.5+

Install the package:

Configuration

Note: Your custom repository must implement IRepository contract.

Getting repository inside your code

To get specific repository in your code you can just build with DI container repositories factory and then build needed for your repository in this factory.
Example:

Filtering results with repository

Methods findWhere/getWhere/getWith/getPage/getCursorPage/count/ can receive criteria as params Here the examples of available syntax:

In this case = operator and and boolean between them will be used.
Example: ... 'field1 = 'value1' and 'field2' = 1 ...

Important: arrays and collection can be used only with in and not in operators.
Note: As 4th parameter you can pass boolean or/and (and uses by default). But you should remember that boolean used between current and previous criterion
Example: ... 'field1 <> 'value1' or 'field2' > 1 and 'field3' in (1, 2) and 'field4' not in (1, 2) ...

Result will be the same as in previous example.

Note: you can add nesting level in any depth what you want. To use or condition between one group and other(group and non-group condition) you can pass 'boolean' parameter in the same level as other conditions.

Example:... ('field1 <> 'value1' or 'field2' > 1) or ('field3' in (1, 2) and 'field4' not in (1, 2)) ...

Preload model relations

Method getWith() method allows to retrieve list of entities with
eager loaded related models and related models counts. Also allows to filter this list by given criteria
and sort in requested order.

Example:

Exceptions

Repository Exception

Base exception for repository layer.

Repository register exception

Throws when can not register custom repository.

Model not found Exception

Throws in case when some model not exists in storage.

Bad Criteria Exception

Throws when provided criteria has incorrect format at least in one criterion inside.

Contributing

  1. Create fork, checkout it
  2. Develop locally as usual. Code must follow PSR-1, PSR-2 -
    run PHP_CodeSniffer to ensure, that code follows style guides
  3. Cover added functionality with unit tests and run PHPUnit to make sure, that all tests pass
  4. Update README.md to describe new or changed functionality
  5. Add changes description to Semantic Versioning convention to determine next version number.
  6. When ready, create pull request

Make shortcuts

If you have GNU Make installed, you can use following shortcuts:

Resources


All versions of laravel-repositories with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
illuminate/support Version >=5.5 <12.0
illuminate/database Version >=5.5 <12.0
saritasa/dingo-api-custom Version 3.0.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 saritasa/laravel-repositories contains the following files

Loading the files please wait ....