1. Go to this page and download the library: Download webdevjohn/filterable library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
App/Providers/AppServiceProvider.php
public function register()
{
$this->app->bind('FactoryAlias', function ($app) {
return new \Webdevjohn\Filterable\FilterFactory(
$app->make(\App\Filters\Components\YourComponent::class)
);
});
}
php artisan filter:make {FilterName}
public function scopeFilters($query, $request)
{
return $this->getFilterFactory('YourFilterFactory')->make($query, $request);
}
public function getLatestTracks($request)
{
return $this->model->WithRelations()
->Filters($request->input())
->orderBy('purchase_date', 'DESC')
->take(12)
->get()
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.