Skip to content

Instantly share code, notes, and snippets.

Avatar

Garagesocial garagesocial

View GitHub Profile
@garagesocial
garagesocial / DeleteCascadeTrait.php
Last active Aug 29, 2015
Laravel Eloquent Helper - Delete Cascade Relations
View DeleteCascadeTrait.php
<?php
/**
* Class DeleteCascadeTrait
*
* Simplify the process of delete cascade in eloquent.
*
* use DeleteCascadeTrait;
* public static function getDeleteCascadeRelations() { return array('myrelation'); }
*/
@garagesocial
garagesocial / hfxHelper.php
Last active Nov 1, 2016
Create etrepat/baum Header from XML Defined Hierarchy
View hfxHelper.php
<?php
/**
* Create headers from an xml string consisting of a hierarchy of nodes with attributes
* (ex: <header name="A"> <header name="AB" /> <header name="AC"> <header name="AD" /> </header> </header>
*
* @param string $content XML string containing hierarchy of nodes
* @return void
*/
public function hfxParseContent($content) {
@garagesocial
garagesocial / filters.php
Last active May 27, 2020 — forked from zmsaunders/filters.php
Laravel Filter Helper - Compress HTML Output & Strip Comments
View filters.php
<?php
### --- Snip --- ###
App::after(function($request, $response)
{
// HTML Minification
if(App::Environment() != 'local')
{
if($response instanceof Illuminate\Http\Response)