Skip to content

Instantly share code, notes, and snippets.

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 Nov 15, 2018 — 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)
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.