Home Laravel How to Get URL Segment in Laravel?

How to Get URL Segment in Laravel?

by Shahriar Sagor

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.

close

You may also like