Created
January 19, 2016 20:49
-
-
Save j3j5/91e03306e2c4a9d695c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* routes.php would be something like: | |
* | |
* Route::get('/my/path/{id}', ['as' => 'ExamplePath', 'uses' => 'ExampleController@getPath']); | |
*/ | |
// Get the full URL from the current request --> http://example.com/my/path/1 | |
request()->url(); | |
// Get the path from the current request --> my/path/1 | |
request()->path(); | |
// Get the path for the current route --> my/path/{id} | |
Route::getCurrentRoute()->getPath(); | |
// Get the name for the current route --> ExamplePath | |
Request::route()->getName(); | |
// Get the action name for the current route --> ExampleController@getPath | |
Route::getCurrentRoute()->getActionName(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment