Change method boot
use Carbon\Carbon;
public function boot()
{
config(['app.locale' => 'id']);
| name: CI/CD workflow | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| testing: |
| # Change to the project directory | |
| cd $FORGE_SITE_PATH | |
| # Turn on maintenance mode | |
| php artisan down || true | |
| # Pull the latest changes from the git repository | |
| # git reset --hard | |
| # git clean -df | |
| git pull origin $FORGE_SITE_BRANCH |
| <?php | |
| Builder::macro('deferredPaginate', function ($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) { | |
| $model = $this->newModelInstance(); | |
| $key = $model->getKeyName(); | |
| $table = $model->getTable(); | |
| $paginator = $this->clone() | |
| // We don't need them for this query, they'll remain | |
| // on the query that actually gets the records. |
| In this tutorial i’ll explain how to make an easy make:trait command so you can easily whip up traits. | |
| First, start of by making the command: | |
| php artisan make:command TraitMakeCommand | |
| Now open up app/console/commands/TraitMakeCommand.php and make the contents as following: | |
| <?php | |
| namespace App\Console\Commands; | |
| use Illuminate\Console\GeneratorCommand; |
| <?php | |
| namespace App\Console\Commands; | |
| use Illuminate\Console\Command; | |
| use Illuminate\Support\Facades\File; | |
| use Illuminate\Support\Facades\Artisan; | |
| use Illuminate\Support\Facades\Config; | |
| use Illuminate\Support\Facades\DB; |
| # GithHub Actions Workflow generated with Ghygen | |
| # Original configuration: https://ghygen.hi-folks.dev?code=fc3b529dfc5a8a6764eeba4300a0b1ad | |
| name: Template - Laravel application (Mysql) | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| - features/** | |
| pull_request: |