How to identify which method called the view in Laravel 5.4?

0

How can I identify which método is calling view within itself?

Example:

IndexController.php

public function create() {
    return view('index');
}

Inside the file view/index.blade.php how do I return the method that called, in this example I want to return create or create() .

    
asked by anonymous 29.08.2017 / 03:20

1 answer

0

Just use getActionName

echo Route::getCurrentRoute()->getActionName();
    
29.08.2017 / 11:41