Level 75
Have you tried passing Route $route in the parenthesis.
But not sure, but I believe this works from a method, but you can try it from constructor.
The API doesn't really cover this in much detail.
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
So recently I used the getActionMethod() function on my controller __construct(), it seems to work properly, but when I run php artisan route:list it throws Call to a member function getActionMethod() on null.
Here is my usage:
$this->method = request()->route()->getActionMethod()
Please or to participate in this conversation.