Laravel Get Current URL in Blade Example

Today, We want to share with you Laravel Get Current URL in Blade Example.In this post we will show you wordpress plugin require another plugin, hear for laravel get current url with parameters we will give you demo and example for implement.In this post, we will learn about laravel get current url without domain with an example.

Laravel Get Current URL in Blade Example

There are the Following The simple About laravel get current url with parameters Full Information With Example and source code.

As I will cover this Post with live Working example to develop how to get current route name in blade file laravel 6, so the How to check current URL inside @if statement in Laravel 6 is used for this example is following below.

READ :  PHP Laravel Get current url Example

use: Request::url()

@if(Request::url() === 'your main url here')
    // source code Like menu
@endif

get current url in blade view

<a href="{{url()->current()}}">Current Url</a>

How to get current URL in Blade

E-junkie: Sell digital downloads online

E-junkie Provides a Copy-paste buy-now, and cart buttons for selling downloads, codes and tangible products on any website, blog, social media, email and messenger!

Also see:

  1. The Top 10+ Best Webinar Software Platforms For 2020-2021
  2. Build Your Future Godaddy Careers And Jobs
  3. Introduction To Web Hosting Services

using the Request facade.

$current_url = Request::url();
dd($current_url);

using @if or @foreach statements

@if ($prCount > 0)
	{{ Request::url() }}
@endif

Example 2 : How to check current URL or Route

@if (Request::url() == 'your url here')
	// Do source code something
@endif

if (\Route::current()->getName() == 'product') {
  // Godo Luck We are on a correct route!
}

Web Programming Tutorials Example with Demo

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about laravel get url segment.
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.

READ :  custom ng-template Directive using AngularJS Examples