i have multiple bootstrap tabs where each one do different action from others tabs for exmaple
app-url/users#creat-admin-users-tab
app-url/users#creat-regular-users-tab
Is there any way in Laravel to get full url including the #tab-name
Thanks for your time.
Method 1: $request->route('parameter_name') We can access route parameters in two ways. One way is by using $request->route('parameter_name') ., where parameter_name refers to what we called the parameter in the route.
The “path” method is used to retrieve the requested URI. The is method is used to retrieve the requested URI which matches the particular pattern specified in the argument of the method. To get the full URL, we can use the url method.
Laravel has functionality to return you the current url. It is all specified in this page: http://laravel.com/api/5.0/Illuminate/Http/Request.html
What you are looking for is Request::fullUrl()
.
Let's say I'm on http://laravel.dev/test?test=1, here are the methods and the results:
Request::fullUrl() // Returns: http://laravel.dev/test?test=1 Request::url() // Returns: http://laravel.dev/test Request::path() // Returns: test Request::root() // Returns: http://laravel.dev
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With