Skip to content

Instantly share code, notes, and snippets.

@beanmoss
beanmoss / RestControllerTrait.php
Created April 18, 2015 12:12
Playing with Laravel Lumen: simple RESTful trait.
<?php namespace App\Http\Controllers;
use Illuminate\Http\Request;
trait RestControllerTrait
{
public function index()
{
$m = self::MODEL;
return $this->listResponse($m::all());
@beanmoss
beanmoss / dashboard.twig.php
Created April 18, 2015 04:45
LARAVEL: Displaying different module/package dashboard widgets using view composers.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Laravel PHP Framework</title>
<style>
@import url(//fonts.googleapis.com/css?family=Lato:700);
body {
margin:0;