1. Go to this page and download the library: Download syntech/globalscopes 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/ */
syntech / globalscopes example snippets
return [
/*
|--------------------------------------------------------------------------
| Global Query Methods
|--------------------------------------------------------------------------
|
| Define any global query methods that should be available across all
| Eloquent models. These methods can be used to add commonly used query
| functionality to all models.
|
| Example:
| 'active' => function () {
| return $this->where('status', 1);
| },
|
*/
'methods' => [
'active' => function () {
return $this->where('status', 1);
},
'someMore' => function () {
// add more ...
}
],
];