Download the PHP package ulex/epic-repositories without Composer

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

Add a powerful core setup to your application's queries

Documentation, Installation, and Usage Instructions

First, install the package via Composer:


Service Provider

For Laravel

You should publish the RepositoriesServiceProvider:

Optional: The service provider will automatically get registered. Or you may manually add the service provider in your config/app.php file: Laravel

For Lumen

In your bootstrap/app.php add this:


Config

If config file epic-repositories.php was not published copy it to config folder with:

Take some time to review this config file. Here you can adjust various configurations for your repositories setup.

Note: In order to use elastic repository you will have to add "elasticsearch/elasticsearch" package to your composer.json.

Create Repository/ies, Decorator/s with their Interfaces for a Model

First declare your models in config/epic-repositories

Run the following php artisan command:

Depending on you configuration, the necessary folders & classes will be created in your app/Repositories folder. Example:

How to use

This package provides an abstract structure that uses the Repository design pattern with caching decorator/s for you application.

Once installed you can create Repositories for your models that cache the data from your queries. Eloquent and Elastic Repositories are provided and ready to use if enabled. Follow the same principle for any data resource you have on your application.

Extending a model's CachingDecorator

For GET functions use the remember function the same way as in the AbstractCachingDecorator. This will ensure that this function is cached and invalidated properly.

Function remember signature

Functions that return a single result:

PostsEloquentCachingDecorator.php

Note: Remember to add the cache invalidation of the new function by extending flushGetKeys in the model's CachingDecorator.

PostsEloquentRepository.php

Add the query in the model's repository

Functions that return a collection of results:

For GET functions that return collections you MUST pass TRUE to the $isCollection param on remember function.

The above will be flushed in flushGetKeys which calls flushCollections().

Note: If you are adding functions that create a new column, you need to add $this->flushCollections(); after the entry is created so that all collections are flushed and can include your new entry/ies. Check create in AbstractCachingDecorator.

Contributing

This package is mostly based on Jeffrey Way's awesome Laracasts lessons when using the repository design pattern on Laravel From Scratch series.

License

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


All versions of epic-repositories with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.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 ulex/epic-repositories contains the following files

Loading the files please wait ....