Skip to content

Instantly share code, notes, and snippets.

View alchemydigital's full-sized avatar

Alchemy Digital alchemydigital

View GitHub Profile
@alchemydigital
alchemydigital / L4-SuperEloquent.php
Last active August 29, 2015 14:18
A simple extension to Eloquent to easily perform functions before a model is saved (Laravel 4)
<?php
class SuperEloquent extends Eloquent
{
protected $before_save = array();
public function __construct($attributes = array())
{
parent::__construct($attributes);
}
@alchemydigital
alchemydigital / countries.php
Last active August 29, 2015 14:18
Countries and US states with their two-character ISO short code - useful for creating select menus of countries for payment details.
<?php
return array(
/*
|--------------------------------------------------------------------------
| ISO Countries
|--------------------------------------------------------------------------
|
| Associative array of all countries with their two-character ISO code
|