So I decided to go from Laravel 4 to 5, which took me about 1-2 days, because I barely knew how to make the transition. When running Upgrade for my application, I ran into a small problem with Json Pagination.
This code allows you to break a PageQuery page through KnockoutJS
/** * Builds paginate query with given parameters. * * @param array $params * @param integer $page * @param integer $perPage * * @return array */ public function buildPaginateQuery(array $params, $page = 1, $perPage = 15) { $query = $this->model; $query = $this->appendParams($params, $query); $count = (new Cache)->remember('count', '2000', function() use ($query){ return $query->count(); }); $totalPages = $count / $perPage; $query = $query->skip($perPage * ($page - 1))->take($perPage); $query = $query->order(isset($params['order']) && $params['order'] ? $params['order'] : null); //$query = $query->cacheTags(array($this->model->table, 'pagination'))->remember(2000); $query = (new Cache)->remember(array($this->model->table, 'pagination'), '2000', function() use ($query){ return $query; }); return array('query' => $query, 'totalPages' => $totalPages, 'totalItems' => $count); }
which ultimately leads to this error in this screenshot 
The error is indicated in the code above, namely this code
protected function path($key) { $parts = array_slice(str_split($hash = md5($key), 2), 0, 2); $path = $this->directory() . '/'.join('/', $parts).'/'.$hash;
I am using my own TaggedFile cache driver. This worked fine in L4, but ran into errors because files were deleted in Cache Alias. Like StoreInterface. Can I get some help for this? If you need me to publish everything I want.
More materials:
Before I used this to register the taggedFile driver in the global.php file:
Cache::extend('taggedFile', function($app) { return new Illuminate\Cache\Repository(new Lib\Extensions\TaggedFileCache); });
I donβt know where to put it. Does anyone know the equivalent of this? I tried putting it in an AppServiceProvider, but an error came up:
Call to undefined method Illuminate\Support\Facades\Cache::extend()
This was used to work in L4, so I decided to go to the vendor folder manually to find out what the problem was.
It only had: getFacadeAccessor (which L4 also only handled, so I decided to use getFacadeAccessor and it worked, but I don't know if this was a solution or not.