Skip to content

Instantly share code, notes, and snippets.

Avatar

Dustin Fraker drfraker

View GitHub Profile
@drfraker
drfraker / AssignRole.php
Last active Apr 3, 2020
LiveWire realtime search bug.
View AssignRole.php
<?php
namespace App\Http\Livewire;
use App\Staff;
use App\User;
use Livewire\Component;
class RolesAssign extends Component
{
View RegisterController.php
<?php
namespace App\Http\Controllers\Auth;
use App\Owner;
use App\Organization;
use App\Billing\PaymentGateway;
use Illuminate\Support\Facades\DB;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Hash;
@drfraker
drfraker / Live Template For PHPUnit Tests
Last active Mar 4, 2021
Live Template For PHPUnit Tests
View Live Template For PHPUnit Tests
// 1. In PhpStorm go to: Preferences > Editor > Live Templates.
// 2. Click on the + button on the top right to create a new template.
// 3. Enter "@test" (no quotes) in the Abbreviation field, and give the template a name. (mine is named test case)
// 4. Copy and paste the code below into the "Template text:" section in PhpStorm
/** @test */
$NAME$
public function $SNAKENAME$()
{
$END$
@drfraker
drfraker / generator.php
Created Oct 10, 2012
Laravel Generator by Jeffrey Way
View generator.php
<?php
/**
* Laravel Generator
*
* Rapidly create models, views, migrations + schema, assets, tests, etc.
*
* USAGE:
* Add this file to your Laravel application/tasks directory
* and call the methods with: php artisan generate:[model|controller|migration] [args]
@drfraker
drfraker / snippet.xml
Created Sep 22, 2012 — forked from JeffreyWay/snippet.xml
Laravel Resource - Sublime Text 2 Snippet
View snippet.xml
<snippet>
<content><![CDATA[
// ${1} Resource
Route::get('${1}s', array('as' => '${1}s', 'uses' => '${1}s@index'));
Route::get('${1}s/(:any)', array('as' => '${1}', 'uses' => '${1}s@show'));
Route::get('${1}s/new', array('as' => 'new_${1}', 'uses' => '${1}s@new'));
Route::get('${1}s/(:any)edit', array('as' => 'edit_${1}', 'uses' => '${1}s@edit'));
Route::post('${1}s', '${1}s@create');
Route::put('${1}s/(:any)', '${1}s@update');
Route::delete('${1}s/(:any)', '${1}s@destroy');