-2

I wonder if how i can get the Controller name and Action name in the Blade template/View?

Thanks in advance!

Faid
  • 554
  • 1
  • 5
  • 18
Nermeen
  • 3
  • 2

1 Answers1

0

A few options.

Pass variables to the view from your controller. Set a global view variable use view composer. You need to choose one of these depending on your use case.

Route::getCurrentRoute()->getAction();
Route::currentRouteAction();
Route::currentRouteName();
Faid
  • 554
  • 1
  • 5
  • 18