Skip to content

Instantly share code, notes, and snippets.

View jkuchynka's full-sized avatar

Jason Kuchynka jkuchynka

View GitHub Profile
@jkuchynka
jkuchynka / gist:11006322
Created April 17, 2014 19:26
angular401interceptor
angular.module('angularAuth', ['ngCookies'])
.config([
'$routeProvider',
'$locationProvider',
'$httpProvider',
function ($routeProvider, $locationProvider, $httpProvider) {
// ...
var interceptor = ['$location', '$q', function($location, $q) {
@jkuchynka
jkuchynka / L4ResourceRouteHelper.php
Last active December 31, 2015 21:19
L4 has no support for defining a complete custom name for resource routes. The URI path is tied to the resulting route name Route::resource('users', 'UsersController') Produces Names like "resources.users.index", and "resources.users.create" and so on If changing the path later on like so: Route::resource('admin/users', 'UsersController') Change…
<?php namespace L4Extras;
use Illuminate\Support\Facades\Route;
class RouteHelper {
/**
* This function creates all your resource routes (index, create, store, show, edit, update, destroy)
* for you automatically like a Route::resource() would
* $resourceGenerator('users', 'UserController', 'resource.users')