1. Go to this page and download the library: Download makeabledk/laravel-querykit 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/ */
class Job extends Eloquent {
use \Makeable\QueryKit\QueryKit;
public function scopeHired($query)
{
return $query->whereIn('status', ['started', 'finished']);
}
}
Job::hired()->first(); // a job with either 'started' or 'finished' status
/**
* Check if a model passes the given scope
*
* @param $name
* @param array ...$args
* @return bool
*/
public function passesScope($name, ...$args)
/**
* Check if a model fails the given scope
*
* @param $name
* @param array ...$args
* @return bool
*/
public function failsScope($name, ...$args)
class WhereBetween implements \Makeable\QueryKit\Contracts\QueryConstraint
{
public function __construct(...$args)
{
// Accept scope arguments here
}
public function check($model)
{
// Return boolean
}
}
public function register()
{
\Makeable\QueryKit\Builder\Builder::registerConstraint(WhereBetween::class);
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.