Skip to content

Instantly share code, notes, and snippets.

View jwhulette's full-sized avatar
🏠
Working from home

Wes Hulette jwhulette

🏠
Working from home
View GitHub Profile
@jwhulette
jwhulette / .php-cs-fixer.dist.php
Created August 12, 2023 20:16
[php-cs-fixer.dist.php] #php
<?php
declare(strict_types=1);
/**
* -----------------------------------------------------
* Enforce the Laravel Code Style using PHP CS Fixer 3.x
* -----------------------------------------------------
* Credits go to Laravel Shift & Andreas Elia.
* https://gist.github.com/laravel-shift/cab527923ed2a109dda047b97d53c200.
**/
@jwhulette
jwhulette / idea.properties
Created June 29, 2023 18:33
[PhpStorm SpeedUp] #PhpStorm
# custom PhpStorm properties (expand/override 'bin/idea.properties')
editor.zero.latency.typing=true
@jwhulette
jwhulette / phpstorm.vmoptions
Last active June 29, 2023 18:34
[PhpStorm SpeedUp] #PhpStorm
-Xms500m
-Xmx2048m
-Dawt.useSystemAAFontSettings=lcd
-Dawt.java2d.opengl=true
# Only for people on Mac, it makes Java use an optimised graphics engine.
-Dapple.awt.graphics.UseQuartz=true
@jwhulette
jwhulette / Switch PHP
Last active January 18, 2023 20:37
[Brew Switch PHP]
# add to .zshrc to switch brew php versions
alias php82='{ brew unlink php@8.1; brew link php --force --overwrite; } &> /dev/null && php -v'
alias php81='{ brew unlink php; brew link php@8.1 --force --overwrite; } &> /dev/null && php -v'
@jwhulette
jwhulette / git_forget.txt
Created November 23, 2022 17:55
[GIT Forget] #git
Add to
~/.gitconfig
[alias]
forget="! /usr/local/bin/git fetch -p && /usr/local/bin/git branch -vv | awk '/: gone]/{print $1}' | xargs /usr/local/bin/git branch -D"
@jwhulette
jwhulette / Column.php
Last active May 28, 2023 20:50
[Check if column exists] #php #laravel
<?php
declare(strict_types=1);
namespace Database\Helpers;
use Illuminate\Support\Facades\Schema;
class Column
{
@jwhulette
jwhulette / ForeignKey.php
Last active May 28, 2023 20:50
[Check if foreign key exits] #php #laravel
<?php
declare(strict_types=1);
namespace Database\Helpers;
use Illuminate\Support\Facades\Schema;
class ForeignKey
{
@jwhulette
jwhulette / EnhancedEnum.php
Created September 22, 2022 12:14 — forked from aneesdev/EnhancedEnum.php
EnhancedEnum PHP trait
<?php
trait EnhancedEnum
{
/**
* Get the enum value from the name. e.g case INVOICE = 'invoice'; will return 'invoice'
*
* @param string $name
* @return static
*/
@jwhulette
jwhulette / snippet.txt
Created September 13, 2022 12:48
[Change env setting for testing] #PHP #Laravel
$this->app->detectEnvironment(fn () => 'develop');
@jwhulette
jwhulette / RefreshDatabase.php
Last active December 2, 2022 17:59
[Refresh multiple databases]
<?php
declare(strict_types=1);
namespace Tests;
use Illuminate\Foundation\Testing\RefreshDatabase as FrameworkRefreshDatabase;
use Illuminate\Foundation\Testing\RefreshDatabaseState;
trait RefreshDatabase