Laravel – get current url on blade page for active class

Developers use active class for show highlight the current page in the @include file like header.php. So we need current URL for check active page. I am telling you how to get current URL on blade page in Laravel.

Follow this code:

This code return full URL without query string

For full URL with query string

Get segment from URL

For return only path without site URL

If you really like this post. Please Comment or share with social buttons for others help. You can more read useful articles



    • Mr. Rahul

Add a Comment

Your email address will not be published. Required fields are marked *