Skip to content

Instantly share code, notes, and snippets.

@mass6
mass6 / laranew.sh
Created November 17, 2020 13:35 — forked from WyattCast44/laranew.sh
#!/bin/bash
laravel new $1
# Change Dir
cd $1
# Update .env
sed -i "s/APP_NAME=Laravel/APP_NAME=$1/g" .env
sed -i "s/DB_DATABASE=laravel/DB_DATABASE=$1/g" .env
@mass6
mass6 / post_install.sh
Created April 15, 2018 22:58 — forked from derrekbertrand/post_install.sh
PHP development machine post install setup for Ubuntu 16.04 LTS and Mint 18 LTS.
#!/bin/bash
# Post install script for Ubuntu 16.04LTS and Mint 18LTS
# add the PHP PPA https://deb.sury.org/
sudo add-apt-repository -y ppa:ondrej/php
# I believe even releases are LTS, so when 8 comes out should update
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
# add Sublime Text 3 stable to your sources
@mass6
mass6 / FiniteAuditTrailTrait.php
Created October 27, 2016 09:14 — forked from tortuetorche/FiniteAuditTrailTrait.php
FiniteStateMachine and FiniteAuditTrail Traits for Laravel 5.1 (WIP)
<?php namespace App\Finite;
/**
* The FiniteAuditTrail Trait.
* This plugin, for the Finite package (see https://github.com/yohang/Finite), adds support for keeping an audit trail for any state machine.
* Having an audit trail gives you a complete history of the state changes in your stateful model.
* Prerequisites:
* 1. Install Finite package (https://github.com/yohang/Finite#readme)
* 2. Use FiniteStateMachine in your model (https://gist.github.com/tortuetorche/6365575)
* Usage: in your Stateful Class use this trait after FiniteStateMachine trait, like this "use FiniteAuditTrailTrait;".
@mass6
mass6 / 01.FiniteStateMachine.README.md
Created October 27, 2016 09:13 — forked from tortuetorche/01.FiniteStateMachine.README.md
FiniteStateMachine Trait with Example.Add a DSL to the PHP Finite package, borrowed from the Ruby StateMachine gem.

FiniteStateMachine Trait

Add a DSL to the PHP Finite package, borrowed from the Ruby StateMachine gem.

Usage

In your Stateful Class, add the stateMachineConfig() method and call initStateMachine() method at initialization (__contruct() method).

Example