Download the PHP package drapor/cache-repository without Composer

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

What Does This Do?

This laravel package gives a fluid way to cache your queries while speeding up your Eloquent workflow.

Setup:

Install the composer package

 composer require "drapor/cache-repository"

Add the service Provider to your app.php

 'Drapor\CacheRepository\CacheRepositoryServiceProvider' 

Publish the config

` php artisan vendor:publish `

Usage

Step 1 : Modify our Model

Step 2: Create a Repository Class

  <?php namespace app\Repositories;
  use Drapor\CacheRepository\CacheRepository;

     class UserRepository extends CacheRepository
    {
        public function __construct(User $user)
        {
          parent::__construct($user, 'user');

          //Create a Relation instance and pass the second argument as a boolean
          //indicating wether or not it should be removed from the cache when the User object is updated.

          $task = new Relation('task',true);

          //Only call $this->setRelations() if you wish to eager load these relations before every call. This method accepts both
          //instances of Relation and strings. 

         $this->setRelations([
            'group', $task
         ]);
       }
    }

Now You can Inject the Repository wherever you need to use it. This can be done in quite a few ways due to Laravel's magic, but we're going to keep it simple and use a common example.

Step 3 : Inject The Repo

 <?php namespace app/controllers;

 use Repositories/UserRepository; 
 use Request;

 class UserController extends Controller
 {

protected $repository;  

public function __construct(UserRepository $repository)
{
  $this->repository = $repository;
}

public function index()
{
   $limit = Request::input('limit');

   $users = $this->repository
   ->orderBy('name','ASC')
   ->paginate($limit);

   return response()->json($users);
}

public function getSadUsers()
{
   $limit = Request::input('limit');

   //Paginate accepts a second argument for search parameters.
   //This should be an array of arrays, each with at least a key and a value.

   $params =  [
   [ 
      'key'   => 'sad',
      'value' => 'true'
   ],
   [
       'key'        => 'happiness',
        'operator'  => '<',
        'value'     => '2',
        'keyword'   => 'AND'
   ]
   ];

   //Alternatively you can call Argument::extract(Request::input(),'search')
   //and any search information will automatically be formatted

   $users = $this->repository
   ->with('equity','orders')
   ->paginate($limit,$params);

   return response()->json($users->toJson());

}

public function find($id)
{
  $user = $this->repository->with('tasks')->find($id);

  return response()->json($user->toJson());
}

public function update($id)
{
   //The Repository class will automatically clean out any input
   //that isn't fillable by our model.
   $user = $this->repository->update($id,Request::input());

    return response()->json($user->toJson());
}
  }

What should I know?

Planned Feature List

License

The do-whatever-you-want-with-it attributation


All versions of cache-repository with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/support Version >=5.0
illuminate/routing Version >=5.0
illuminate/config Version >=5.0
drapor/networking Version dev-master
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 drapor/cache-repository contains the following files

Loading the files please wait ....