Laravel Get Route:list In Controller
Now let's see exmple of how to get route list in controller in laravel. In this tutorial i will explain you step by step laravel get route:list in controller. we will learn how to get route:list in controller in laravel. you can easily get all route list in laravel application. i will also show how to get route:list in controller in laravel controller.
Let's see step by step process of how to get route:list in controller in laravel Here i will give three way to get route list in laravel controller method So let's see the bellow example.
Example 1
use Illuminate\Support\Facades\Route;
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function homePage()
{
$routesList = Route::getRoutes();
dd($routesList);
}
Example 2
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function homePage()
{
$routesList = \Route::getRoutes()->get();
dd($routesList);
}
Example 3
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function homePage()
{
\Artisan::call('route:list');
return \Artisan::output();
}
It will help you....
- How to Notifications With database Driver in Laravel 11?
- How to Send Email Via Notification in Laravel 11?
- How to Install and Configure Laravel 11 Debugbar?
- How to Like Dislike System in Laravel 11?
- How to Paginate a Model with Relationship in Laravel 11?
- Laravel 11 Upload Files to Amazon S3 Example
- Laravel 11 Send WhatsApp Messages Example
- Laravel 11 Rest API Authentication Using JWT Tutorial