Skip to content

Instantly share code, notes, and snippets.

Peter Weil plweil

Block or report user

Report or block plweil

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
plweil / RouteHelper.php
Created Mar 31, 2015
Laravel 5 Class method for returning names of current controller (minus the string 'Controller'), and method (action) from current route.
View RouteHelper.php
<?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);
You can’t perform that action at this time.