php laravel problem help
迷茫
迷茫 2017-05-16 16:54:51
0
3
485
  1. Laravel 5 How to get the function name of the current controller?

I often see Request $request written this way. What is this knowledge point called?

public function __construct(Guard $auth)
    {
        $this->auth = $auth;
    }
public function store(Request $request)
    {
        //
    }
迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(3)
左手右手慢动作

Dependency injection

Assign an object to a property and call it

曾经蜡笔没有小新

First question:
In LaravelRoute::current()->getActionName(); you can get the detailed name of the current Action, which may not be the result you want directly. Just process the results returned by the above method yourself.

Second question:

The $request parameter here is IlluminateHttpRequest, which is passed to the Controller through dependency injection.

In Laravel, the Controller can use Request in the parameters after using IlluminateHttpRequest at the top.

Request contains the request content sent by the client.

伊谢尔伦

This product uses dependency injection, which makes the performance very low

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template