Skip to content

Instantly share code, notes, and snippets.

View JeremiahTolbert's full-sized avatar

JeremiahTolbert

View GitHub Profile
@JeremiahTolbert
JeremiahTolbert / ajax-filter.php
Created November 18, 2012 03:37
Laravel Ajax Filter for Controllers
<?php
//This part would be included in the controller itself like so:
class Articles_Controller extends Controller {
public function __construct() {
parent::__construct();
$this->filter('before', 'csrf')->on('post');
$this->filter('before', 'ajax')->only(array('index', 'show', 'update'));
}