Framework: Route::currentRouteName() returns the route name with the word "get" as prefix.

Created on 20 Sep 2013  Â·  5Comments  Â·  Source: laravel/framework

Hello,

After read this threat #573 I used the following code to get the current route name.

echo Route::currentRouteName();

But the result is: get patient/add. As you can see the output has the word get. I want to know if this is an error or how can I get just the route name without 'get' word.

My Full URL: http://domain.co/patient/add
I have attached an image to show you the code and the output.

Thank you.

Juan Escobar

currentroutename

Most helpful comment

Try with

Request::path()

All 5 comments

Same here, even after updating to laravel/framework 4.0.x-dev 7836868

<?php  // test.blade.php
?>
{{ Route::currentRouteName() }}

Result:

get test

Try with

Request::path()

@brunogaspar it's works :) Thank you.

But, the currentRouteName() function are working as expected or that 'get' is an error?

Well – to me at least – GET products is a route, products/ is a path or an URL, if you want the latter then getCurrentRouteName isn't the right method.

@Anahkiasen I understand now. I did not know the difference between route and path.

Thank you all.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

YannPl picture YannPl  Â·  3Comments

kerbylav picture kerbylav  Â·  3Comments

fideloper picture fideloper  Â·  3Comments

Anahkiasen picture Anahkiasen  Â·  3Comments

lzp819739483 picture lzp819739483  Â·  3Comments