How to Get URL Segment in Laravel?

Share Me
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Today now in this post i will show you how to get url segment in laravel application. Whenever sometimes we need to get the current url segment then we can get this by using Request facade. Now here I will give you an example one for by using Request facade.

so from here you can get the segment from url and you will also know how we can use both of example.

Example:

@extends('layouts.app')
@section('content')
	{{ Request::segment(1) }}
@endsection

Read Also : How to convert Object into Array in PHP?

Thanks for read. I hope it help you. For more you can follow us on facebook.

About code chef

My name is Shahriar sagor. I'm a developer. I live in Bangladesh and I love to write tutorials and tips that will help to other Developer's. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.

View all posts by code chef →