Skip to content

Instantly share code, notes, and snippets.

View plweil's full-sized avatar

Peter Weil plweil

  • University Marketing
View GitHub Profile
@plweil
plweil / RouteHelper.php
Created March 31, 2015 13:44
Laravel 5 Class method for returning names of current controller (minus the string 'Controller'), and method (action) from current route.
<?php namespace App\Http;
use Illuminate\Routing\Route;
class RouteHelper {
/**
* Get and return names of current controller, minus the string 'Controller', and method (action) from current route.
* To use, enter the following into your controller method:
* list($controller, $action) = RouteHelper::controller_action($route);