Get The First Directory Path From Url In Laravel 5.1
I want to be able to get the first path directory from a URL in Laravel 5.1. For example, take a look at the following url:
From the above url, I want to return
Does anyone know how I can achieve this?
You can use uri segment.
$segment = Request::segment(1); dd($segment);
Hope it will help.Thanks
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → October CMS - Conditionally Load a Different Page
- → How to disable assets combining on development in OctoberCMS
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → OctoberCms component: How to display all ID(items) instead of sorting only one ID?
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?