class ControllerStubs

Helper class for controller related console commands.

Methods

static string
defaultTemplate(string $controllerName, string $layout)

The default template for a new controller.

static string
reactTemplate(string $controllerName, string $layout)

Template for a React-backed (JSON API) controller. Uses the JsonResponse trait and returns JSON instead of rendering a view.

static string
resourceTemplate(string $controllerName, string $layout)

The template that contains additional useful functions for a controller.

Details

at line 16
static string defaultTemplate(string $controllerName, string $layout)

The default template for a new controller.

Parameters

string $controllerName

The name of the controller.

string $layout

The layout to be set.

Return Value

string

The contents for a new controller.

at line 47
static string reactTemplate(string $controllerName, string $layout)

Template for a React-backed (JSON API) controller. Uses the JsonResponse trait and returns JSON instead of rendering a view.

Parameters

string $controllerName

The name of the controller.

string $layout

Unused for API controllers; kept for signature parity with the other templates.

Return Value

string

The contents for a new React/API controller.

at line 129
static string resourceTemplate(string $controllerName, string $layout)

The template that contains additional useful functions for a controller.

Parameters

string $controllerName

The name of the controller.

string $layout

The layout to be set.

Return Value

string

The contents for a new controller.