1. Go to this page and download the library: Download skycoder/query-shorter 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/ */
skycoder / query-shorter example snippets
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Skycoder\QueryShorter\QueryShorter;
class Employee extends Model
{
use QueryShorter;
}
$employees = Employee::query()
->likeSearch('name')
->searchByField('department_id') // check if the request has `department_id` value then we query
->searchByField('designation_id', "!=")
->searchByField('age', "<")
->searchDateFrom('joining_date') // `joining_date` is database field and `from_date` from request
->searchDateTo('joining_date') // `joining_date` is database field and `to_date` from request
->searchDateFrom('retirement_date', 'from_retirement_date') // `retirement_date` is database field and `from_retirement_date` from request
->searchDateTo('retirement_date', 'to_retirement_date') // `retirement_date` is database field and `to_retirement_date` from request
->dateFilter()
->searchFromRelation('contact_info', 'division')
->selectName('employee_type')
->selectName(['department', 'designation', 'grade'])
->latest()
->get();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.