Skip to content

Instantly share code, notes, and snippets.

View nissicreative's full-sized avatar

Mike Folsom nissicreative

View GitHub Profile
@nissicreative
nissicreative / Default (OSX).sublime-keymap
Last active March 24, 2017 14:16
Sublime Text Keymap
[
// Sublime Menus
{ "keys": ["super+k", "super+t"], "command": "title_case" },
{ "keys": ["alt+super+w"], "command": "toggle_setting", "args": {"setting": "word_wrap" }},
{ "keys": ["shift+alt+super+w"], "command": "wrap_lines" },
// PHP Companion
{ "keys": ["f9"], "command": "expand_fqcn" },
{ "keys": ["shift+f9"], "command": "expand_fqcn", "args": {"leading_separator": true }},
{ "keys": ["f10"], "command": "find_use" },
{ "keys": ["f8"], "command": "import_namespace" },
@nissicreative
nissicreative / laravel-eloquent-relationships.md
Last active May 20, 2021 02:18
Laravel Relationship Methods

Laravel Eloquent Relationships

One To One

Class User

/**
 * Get the phone record associated with the user.
@nissicreative
nissicreative / CodeFormatter.sublime-settings
Last active April 17, 2017 16:49
CodeFormatter User Settings
{
"codeformatter_debug": false,
"codeformatter_php_options": {
"syntaxes": "php", // Syntax names which must process PHP formatter
"php_path": "/usr/local/opt/php71/bin/php", // Path for PHP executable, e.g. "/usr/lib/php" or "C:/Program Files/PHP/php.exe". If empty, uses command "php" from system environments
"format_on_save": false, // Format on save. Either a boolean (true/false) or a string regexp tested on filename. Example : "^((?!.min.|vendor).)*$"
"php55_compat": false, // PHP 5.5 compatible mode
"psr1": false, // Activate PSR1 style
"psr1_naming": false, // Activate PSR1 style - Section 3 and 4.3 - Class and method names case
@nissicreative
nissicreative / create_countries_table.php
Created March 6, 2017 21:40
Laravel Countries Table Migration
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCountriesTable extends Migration
{
/**
* Run the migrations.
@nissicreative
nissicreative / CountriesTableSeeder.php
Created March 6, 2017 21:39
Laravel CountriesTableSeeder
<?php
use Illuminate\Database\Seeder;
class CountriesTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
@nissicreative
nissicreative / lfm.php
Last active January 6, 2017 02:41
UniSharp Filemanager Config
<?php
return [
// If true, the uploaded file will be renamed to uniqid() + file extension.
'rename_file' => true,
// If rename_file set to false and this set to true, then non-alphanumeric characters in filename will be replaced.
'alphanumeric_filename' => true,
// If true, non-alphanumeric folder name will not be allowed.
'alphanumeric_directory' => false,
@nissicreative
nissicreative / 2014_10_12_000000_create_users_table.php
Last active April 19, 2017 16:56
Laravel Users Table Migration
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
@nissicreative
nissicreative / User.php
Last active October 11, 2017 17:55
Laravel User Model
<?php
namespace App;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Nissi\Traits\FormatsName;
use Nissi\Traits\HasAccessLevel;
use Nissi\Traits\HasAvatar;
@nissicreative
nissicreative / validate-phone.php
Last active January 3, 2017 21:20
Laravel US Phone Validator
<?php
use Illuminate\Support\Facades\Validator;
// Add to AppServiceProvider's boot method
Validator::extend('us_phone', function ($attribute, $value, $parameters, $validator) {
return format_phone($value);
});
@nissicreative
nissicreative / web.php
Last active December 19, 2020 21:53
Laravel Web Routes Stub
<?php
use Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| Public Routes
|--------------------------------------------------------------------------
*/