1. Go to this page and download the library: Download tur1/laravelmodules 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/ */
tur1 / laravelmodules example snippets
class User extends Model
{
/**
* Register filters for the User model.
*
* @return array
*/
public static function filters()
{
return [
StatusFilter::class,
];
}
}
User::withFilters()->get();
class User extends Model
{
protected $search = ['name', 'email', 'roles.name'];
public function roles()
{
return $this->hasMany(Role::class);
}
/**
* Register filters for the User model.
*
* @return array
*/
public static function filters()
{
return [
StatusFilter::class,
];
}
}