Basically I'm calling an event every time a Controller method runs:
public function destroy(User $user)
{
event(new AdminActivity('admin.users.destroy',class_basename(Route::current()->controller),'destroy','DELETE'));
...
}
In fact it is saving this information:
event(new AdminActivity(ROUTE_NAME,CONTROLLER_NAME,CONTROLLER_METHOD_NAME,CONTROLLER_METHOD_TYPE));
Now instead of passing parameters manually, I want to pass the required parameters automatically.
So I need to get route name, controller method name and controller method type auto (just like the class_basename(Route::current()->controller) which returns the controller name).
So how can I do that ?