Dennis Braga
Dennis Braga

Reputation: 1478

Could I know, inside the controller, the current URL?

There's a way of know the current URL on a controller at Laravel?

Upvotes: 0

Views: 61

Answers (3)

Ryan
Ryan

Reputation: 107

URL::current() does what you're looking for I believe.

Upvotes: 0

Michael Cordingley
Michael Cordingley

Reputation: 1525

Try $_SERVER['REQUEST_URI'].

If you need more than just the current URI, you can find all of the pieces on the $_SERVER array. The documentation on that array: http://www.php.net/manual/en/reserved.variables.server.php

Upvotes: 0

WebNovice
WebNovice

Reputation: 2220

You can use the following function from the Request class.

Request::url()

Upvotes: 2

Related Questions