PHP Class Indatus\Ranger\ApiBaseController

This controller contains default behavior for controller actions such that a controller could just refer to the parent unless other custom functionality is needed.
Inheritance: extends Illuminate\Routing\Controller
Mostrar archivo Open project: indatus/ranger

Protected Properties

Property Type Description
$belongsTo The variable should be set with the pluralized lowercase name of the parent. i.e. 'products'

Protected Methods

Method Description
handleAction ( Model $model, integer $id = null, array $parentData = [], array $additionalAssigns = [] ) : View | string Function to handle the default behavior for all restful actions, from the CRUD operations to rendering the appropriate response based on the request format.

Method Details

handleAction() protected method

This function essentially looks at what URL was called, and determines the action that should be ran, then hands off the execution to a separate function specific to that action.
protected handleAction ( Model $model, integer $id = null, array $parentData = [], array $additionalAssigns = [] ) : View | string
$model Illuminate\Database\Eloquent\Model The model class that the controller is handling
$id integer The ID of the particular record in question IF the action requires it
$parentData array The key / value data for identifying parent for nested resources
$additionalAssigns array Array of additional data to be made available to the view
return View | string | string The rendered template, or JSON data

Property Details

$belongsTo protected_oe property

The variable should be set with the pluralized lowercase name of the parent. i.e. 'products'
protected $belongsTo