In Laravel 5, we can get the current route (say the class instance) using the Illuminate\Http\Request
class, using the route
method.
So:
public function handle(Request $request)
{
$rota = $request->route();
}
What about Laravel 4? How can I do this?
I need to know at a certain point what the current route is being requested.
For example:
App::before(function ($request)
{
$rota = /** Quero descobrir como pegar a rota atual aqui **/
});