In this article, we will see how to get the current URL in laravel. if you want to get the current page URL in laravel 8 then we can use many methods such type current(), full(), request(), url(). Here I will give you an example of laravel get current URL. In this example, I have used helper and function.
So, le's see laravel 8 get current url, get current page url in laravel 8, get full url in laravel 8, find current url in laravel 8, laravel 8 get url path, how to get current url in laravel controller, how to get current url in laravel blade
$currenturl = url()->full();
dd($currenturl);
$currenturl = url()->current();
dd($currenturl);
$currenturl = Request::url();
dd($currenturl);
$currenturl = URL::current();
dd($currenturl);
$currenturl = URL::full();
dd($currenturl);
$pre_url= url()->previous();
dd($pre_url);
$cur_route = Route::current()->getName();
dd($cur_route);
You might also like :