Skip to content

Instantly share code, notes, and snippets.

View garagesocial's full-sized avatar

Garagesocial garagesocial

View GitHub Profile
@garagesocial
garagesocial / filters.php
Last active February 6, 2023 04:11 — forked from zmsaunders/filters.php
Laravel Filter Helper - Compress HTML Output & Strip Comments
<?php
### --- Snip --- ###
App::after(function($request, $response)
{
// HTML Minification
if(App::Environment() != 'local')
{
if($response instanceof Illuminate\Http\Response)
@garagesocial
garagesocial / hfxHelper.php
Last active November 1, 2016 14:32
Create etrepat/baum Header from XML Defined Hierarchy
<?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 / DeleteCascadeTrait.php
Last active August 29, 2015 14:05
Laravel Eloquent Helper - Delete Cascade Relations
<?php
/**
* Class DeleteCascadeTrait
*
* Simplify the process of delete cascade in eloquent.
*
* use DeleteCascadeTrait;
* public static function getDeleteCascadeRelations() { return array('myrelation'); }
*/