Retriving requested path in Laravel 5.4

How can you retrieve requested path in Laravel.

You can retrieve requested path in controller by using path() method of Laravel Request class. Below is sample uses



namespace AppHttpControllers;
use IlluminateHttpRequest;
class DemoController extends Controller{

public function index(Request $request){
$requested_path=$request->path();

}
}

Leave a Reply

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