Laravel - How to get current URL in controller or view?By Hardik Savani | July 20, 2016 | | 1112 Viewer | Category : Laravel
Share this post:
We always require to get current URL path when work on ajax pagination or something, at that we require to get current page URL on Controller or blade file. So, you can get current url easily.
Laravel provide URL facade that way we can get current URL anywhere, as bellow you can see i use current() of URL facade. URL facade through you can get your current page url from every where. So you can check your current url this way:
$currentURL = URL::current();
- How to add prefix in each key of PHP Array?
- How to check request method is GET or POST in Laravel?
- Laravel - How to get current URL in controller or view?
- How to integrate google map using gmaps.js in php example?
- Ajax - Cross-Origin Request Blocked in Larave 5?
- Multiple database connections in laravel 5 Application
- How to convert object to array in Laravel 5?
- Laravel 5 clear cache from route, view, config and all cache data from application