Skip to content

Instantly share code, notes, and snippets.

@snetty
Created April 13, 2014 16:59
Show Gist options
  • Save snetty/10592545 to your computer and use it in GitHub Desktop.
Save snetty/10592545 to your computer and use it in GitHub Desktop.
example laravel controller with ajax detection
public static function view($view){
return 'base.' . (Request::ajax() ?: 'ajax.') . $view;
}
public function create()
{
return View::make(self::view('create'), $this->viewVars());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment