1

route('products.create') returns full path like http://myapp.dev/products/create.

How do I get the actual route? Only this -> products/create?

1 Answer 1

2

There is no such functionality provided by Laravel at this point. However, you may try this:

$extra = URL::to('/'); $actual = route('products.create'); str_replace($extra, '', $actual); 

That will remove the unnecessary base URL from your route URL.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.