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 [email protected]; brew link php --force --overwrite; } &> /dev/null && php -v'
alias php81='{ brew unlink php; brew link [email protected] --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
Last active April 25, 2024 19:13
[Change env setting for testing] #PHP #Laravel
app()->detectEnvironment(fn () => 'production');
$this->refreshApplication();
@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