Posted inLaravel / php

laravel get current url – How to Get Current URL and Site URL in Laravel?

laravel get current url using URL::current(), URL::to(“/”), url(‘/’), Route::current()->getName() and Request::route()->getPrefix() Examples

laravel get current url

Accessing The Current URL You can use: Request::url() to obtain the current URL. Client side You can use url() helper in laravel blade url()->current().

Current URL in Laravel

$exampleTestURI = URL::current();

SIte URL in Laravel

$exampleTestURI = URL::to("/");

or use

$exampleTestURI = url('/');

Get current route name in laravel

$route = Route::current()->getName();

Don’t Miss : Laravel 5.7 Get Current Page URL Path

Get current route prefix name in laravel

$prefix = Request::route()->getPrefix() Examples;

I hope you get an idea about laravel get current url.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

I am Jaydeep Gondaliya , a software engineer, the founder and the person running Pakainfo. I'm a full-stack developer, entrepreneur and owner of Pakainfo.com. I live in India and I love to write tutorials and tips that can help to other artisan, a Passionate Blogger, who love to share the informative content on PHP, JavaScript, jQuery, Laravel, CodeIgniter, VueJS, AngularJS and Bootstrap from the early stage.

Leave a Reply

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

We accept paid guest Posting on our Site : Guest Post Chat with Us On Skype