Skip to content

Instantly share code, notes, and snippets.

@wahdan-amarulloh
wahdan-amarulloh / laravel-ci-cd-workflow.yml
Created June 15, 2023 09:50 — forked from sumonst21/laravel-ci-cd-workflow.yml
Github Action to test laravel and then compile the assets to a production branch
name: CI/CD workflow
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
testing:

Open File App\Providers\AppServiceProvider

Change method boot

use Carbon\Carbon;


public function boot()
{
	config(['app.locale' => 'id']);
@wahdan-amarulloh
wahdan-amarulloh / deploy.sh
Created March 21, 2023 11:31 — forked from BenSampo/deploy.sh
Laravel deploy script
# 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.
@wahdan-amarulloh
wahdan-amarulloh / Create Trait.txt
Created July 13, 2022 14:16 — forked from sharmahemal/Create Trait.txt
Laravel Trait Make Command
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;
@wahdan-amarulloh
wahdan-amarulloh / final_AppInstaller.php
Created July 13, 2022 13:44 — forked from qadirpervez/final_AppInstaller.php
Final App Installer Command
<?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;