Skip to content

Instantly share code, notes, and snippets.

View syofyanzuhad's full-sized avatar
🏳️
I'm not superman

Syofyan Zuhad syofyanzuhad

🏳️
I'm not superman
View GitHub Profile
country code bank
ID ABPEIDJ1XXX ABADI PRISMA EKAMANDIRI, PT
ID ABSDIDJ1XXX ABADI SEKURITAS ADIMASA, PT
ID ADISIDJ1XXX ADITHYA SECURINVEST, PT
ID AGRPIDJ1XXX AGRIDHANASATYA PERMATA, PT
ID AGCCIDJ1XXX AGUNG CAHAYA CENDANA, PT
ID AGSIIDJ1XXX AGUNG SECURITIES INDONESIA, PT
ID AKSKIDJ10JD AKSARA KENCANA, PT
ID AKSKIDJ1XXX AKSARA KENCANA, PT
ID ALDCIDJ1XXX ALDIRACITA CORPOTAMA, PT
@syofyanzuhad
syofyanzuhad / LogoWilayah.php
Last active October 27, 2022 14:03
Laravel Helper to get logo wilayah Indonesia
<?php
namespace App\Helpers;
class LogoWilayah
{
public static function handle($kodeWilayah) {
$logo = self::getLogo($kodeWilayah);
// if $kode is array, loop it
git pull origin main
runuser -u deployer -- composer install --prefer-dist --optimize-autoloader --no-dev
npm ci --no-audit
npm run build
php artisan migrate --seed --force
php artisan optimize
php artisan route:clear
php artisan scribe:generate
<?php
$string = "Indonesia";
function vowelCheck($string)
{
$lower = strtolower($string);
$split = str_split($lower);
$vowel = [];
@syofyanzuhad
syofyanzuhad / Karyawan.php
Created July 21, 2022 11:54
Set mutator of Karyawan NIP
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia;
class Karyawan extends Model implements HasMedia
@syofyanzuhad
syofyanzuhad / laravel-socket-io.md
Created May 21, 2022 11:55 — forked from brainlagid/laravel-socket-io.md
Setup Laravel with Socket.io [Ubuntu 20.04]

Server Requirement

  • Redis sudo apt install redis-server
  • Composer here
  • npm sudo apt install nodejs npm
  • laravel-echo-server npm install -g laravel-echo-server

Laravel Dependencies Requirement

  • predis
  • laravel-echo
  • socket.io-client ^2.4.0 issue
@syofyanzuhad
syofyanzuhad / deploy.sh
Created March 31, 2022 10:17 — 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
@syofyanzuhad
syofyanzuhad / EnumController.php
Created February 21, 2022 09:12
Controller to handle API for your enum
<?php
namespace App\Http\Controllers;
use BenSampo\Enum\Enum;
use Illuminate\Http\Request;
class EnumController extends Controller
{
/**
<?php
/**
* Optimizes PNG file with pngquant 1.8 or later (reduces file size of 24-bit/32-bit PNG images).
*
* You need to install pngquant 1.8 on the server (ancient version 1.0 won't work).
* There's package for Debian/Ubuntu and RPM for other distributions on http://pngquant.org
*
* @param $path_to_png_file string - path to any PNG file, e.g. $_FILE['file']['tmp_name']
* @param $max_quality int - conversion quality, useful values from 60 to 100 (smaller number = smaller file)
@syofyanzuhad
syofyanzuhad / Berita.php
Created January 27, 2022 14:43
Make your model sluggable
<?php
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
class Berita extends Model
{
use HasFactory;