Download the PHP package sebastian-berc/repositories without Composer

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

Repositories

Latest Version on Packagist Build Status Coverage Status SensioLabs Insight Quality Score Total Downloads

Install

Via Composer

Usage

Make your own repository with extends the abstract \SebastianBerc\Repositories\Repository class and implement takeModel method:

Usage with Dependency Incjection

Wherever Laravel provides dependency injection you can attach your repository like this:

Usage without Dependency Injection

If you need a repository without dependency injection you can use the static method like this:

Methods

This gives you access to methods such as...

creating a new query to get all results from repository:

[Need fix] creating a new basic where query clause on model and returns results:

creating a new query with pagination:

saving a new model and return the instance:

saving or updates the model in the database.

Also you can pass a model:

even with additional attributes:

delete the model from the database:

find a model (only first result) by its primary key:

find a model (only first result) by its specified column and value:

find a model (only first result) by its specified columns and values presented as array:

return total count of whole collection based on current query:

fetch collection ordered and filtrated by specified columns for specified page and this method will return instance of LengthAwarePaginator:

fetch simple collection without LengthAwarePaginator, but ordered and filtrated by specified columns for specified page:

Eager loads

If your model has a relationship and you want to load it, you can do this with query results by calling the with method, for example:

Criteria

Sometimes you need to prepare repeatable query that displays, for example, only active and not banned users or the latest news from the week before - to do this you can use a criteria:

Now you can use your criteria with repository:

Transformers

The data from your repositories can be sent to different places, for example, it may be your site or the same data with the exclusion of several columns can be shared with Web API, you can achieve through class Transfomer:

When you have your own Transformer you can apply it to repository:

Cached repository results

To hold query results in a cache just add the implementation of the interface ShouldCache to your repository:

And its magic because from now everything will be cached :).

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of repositories with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
illuminate/contracts Version ~5.0|~5.1|^6.0|^7.0
illuminate/database Version ~5.0|~5.1|^6.0|^7.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 sebastian-berc/repositories contains the following files

Loading the files please wait ....