Skip to content

Instantly share code, notes, and snippets.

@jackfruh
Created June 24, 2015 02:26
Show Gist options
  • Save jackfruh/111f9eacf9b5b04e91c8 to your computer and use it in GitHub Desktop.
Save jackfruh/111f9eacf9b5b04e91c8 to your computer and use it in GitHub Desktop.
class ColorController extends Controller {
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
// if you uncomment the next two lines, it will save the output to colors.html in the laravel public/cache folder
// (I added the cache folder as a subfolder of public, it's not there by default
// you can load it from the browser from http://website/public/cache/colors.html
// $var = view('admin.colors.index')->with('colors', \App\color::paginate(10));
// file_put_contents('/Users/jack/Desktop/WebFiddle.test/Laravel5s/scratchpad/public/cache/colors.html',$var);
// this one returns in about 195ms on my laptop.
// you can load it from the browser via http://website/routetocolorscontroller/
return view('admin.colors.index')->with('colors', \App\color::paginate(10));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment