A

Controller::authorizeAction() — Method in class Controller
Make sure the authenticated user is allowed to perform this type of $action.
Controller::authorizeResource() — Method in class Controller
Make sure the authenticated user is allowed to perform this type of $action on $this->resource.
Controller::adaptResourceQuery() — Method in class Controller
A hook to customize the query for all single resource queries.
Controller::adaptCollectionQuery() — Method in class Controller
A hook to customize the query for all collection queries.
Controller::adaptRules() — Method in class Controller
This is the place to manipulate the validation rules at runtime.
Controller::afterSave() — Method in class Controller
Hook in here to customize actions after saving a resource
Controller::afterConstruct() — Method in class Controller
Use this hook to apply custom logic after the controller instance has been created.
$TransformerProperty in class Transformer
Attributes or relations that shall appear under a different key in the output.
Transformer::addRelation() — Method in class Transformer
Add a single relation.
Transformer::alias() — Method in class Transformer
Apply all rules in $this->aliases and replace key accordingly in output.

B

Controller::beforeSave() — Method in class Controller
Hook in here to customize the input before saving a resource.
Controller::beforeCreate() — Method in class Controller
Hook in here to customize the input before creating a resource.
Controller::beforeUpdate() — Method in class Controller
Hook in here to customize the input before updating a resource.
Transformer::beforeSerialize() — Method in class Transformer
Here you can hook in to change the output before serializing.

C

ControllerClass in namespace SehrGut\Laravel5_Api
The main Controler to inherit from.
$ControllerProperty in class Controller
Controller::createResource() — Method in class Controller
Create a new instance of the current Model, fill it with the input data, save it to the database and load it anew to get all attributes populated.
$FormatterProperty in class Formatter
The Content-Type this Formatter returns.
$FormatterProperty in class Formatter
Holds the instanced of the calling controller.

D

Controller::destroy() — Method in class Controller
Request Handler: Delete a resource.
Controller::destroyResource() — Method in class Controller
Delete the resource.
$ModelMappingProperty in class ModelMapping
The default Transformer to use if none specified.
$ModelMappingProperty in class ModelMapping
The default Validator to use if none specified.
$TransformerProperty in class Transformer
Name the attributes that shall be omitted from the output.
$TransformerProperty in class Transformer
Name the relations that shall be omitted from the output.
Transformer::dropAttributes() — Method in class Transformer

E

ExceptionClass in namespace SehrGut\Laravel5_Api\Exceptions
Exception::errorResponse() — Method in class Exception
Gather the message status and error and return them as a formatted JSON response.
ValidatorException::errorResponse() — Method in class ValidatorException
Gather the message status and error and return them as a formatted JSON response.

F

$ControllerProperty in class Controller
Use this to simply override the Formatter.
$ControllerProperty in class Controller
Controller::formatResource() — Method in class Controller
Generate the response data using our Formatter.
Controller::formatCollection() — Method in class Controller
Generate the response data using our Formatter.
Controller::filterByRequest() — Method in class Controller
Apply filters based on the $key_mapping. If a key is present in the request, an appropriate where clause will be added to the query.
FormatterExceptionClass in namespace SehrGut\Laravel5_Api\Exceptions\Formatter
$ValidatorExceptionProperty in class ValidatorException
Holds the validation errors.
FormatterClass in namespace SehrGut\Laravel5_Api\Formatters
Formatter::format() — Method in class Formatter
Generate a HTTP response body from an Eloquent Collection or Model.
Formatter::formatResource() — Method in class Formatter
Format a single record.
Formatter::formatCollection() — Method in class Formatter
Format an entire collection.
JsonapiFormatter::format() — Method in class JsonapiFormatter
Generate a HTTP response body from an Eloquent Collection or Model.
JsonapiFormatter::formatResource() — Method in class JsonapiFormatter
Format a single record.
Transformer::formatAttributes() — Method in class Transformer
Format all attributes if a function exists that matches their name.

G

Controller::getResource() — Method in class Controller
Fetch a single record from the DB and store it to $this->resource.
Controller::getCollection() — Method in class Controller
Fetch a Collection of Resources from the databse and store it to $this->collection.
Controller::gatherInput() — Method in class Controller
Get the request data from the adapter and store it to $this->input.
Exception::getStatus() — Method in class Exception
Get the HTTP status associated with this Exception (if applicable).
JsonapiFormatter::getModelType() — Method in class JsonapiFormatter
master(Functional programming)
ModelMapping::getTransformerFor() — Method in class ModelMapping
Get the Transformer for a specific model.
ModelMapping::getValidatorFor() — Method in class ModelMapping
Get the Validator for a specific model.
ModelMapping::getUrlFor() — Method in class ModelMapping
Get the url for a specific model.
RequestAdapter::getValueByKey() — Method in class RequestAdapter
Get the value for a given key.
RequestAdapter::getPayload() — Method in class RequestAdapter
Get the request payload.
Validator::getRules() — Method in class Validator
Retrieve the rules of this validator.

H

HttpExceptionClass in namespace SehrGut\Laravel5_Api\Exceptions\Http
RequestAdapter::hasKey() — Method in class RequestAdapter
Check if a given key exists in the request.
Transformer::handleRelations() — Method in class Transformer
Add the relations to the output.

I

$ControllerProperty in class Controller
Controller::index() — Method in class Controller
Request Handler: List all resources.
InvalidDataClass in namespace SehrGut\Laravel5_Api\Exceptions\Formatter
InvalidInputClass in namespace SehrGut\Laravel5_Api\Exceptions\Validator

J

JsonapiFormatterClass in namespace SehrGut\Laravel5_Api\Formatters

K

$ControllerProperty in class Controller
Maps request parameters to database columns.

M

$ControllerProperty in class Controller
Use this to simply override the ModelMapping.
$ControllerProperty in class Controller
$ControllerProperty in class Controller
Controller::makeResponse() — Method in class Controller
Controller::makeModelMapping() — Method in class Controller
Return a ModelMapping instance.
Controller::makeFormatter() — Method in class Controller
Return a Formatter instance.
Controller::makeRequestAdapter() — Method in class Controller
Return a RequestAdapter instance.
$ExceptionProperty in class Exception
The error message displayed to the user.
$FormatterExceptionProperty in class FormatterException
{@inheritdoc}
$InvalidDataProperty in class InvalidData
{@inheritdoc}
$HttpExceptionProperty in class HttpException
{@inheritdoc}
$NotFoundProperty in class NotFound
{@inheritdoc}
$ValidatorExceptionProperty in class ValidatorException
The error message displayed to the user.
$FormatterProperty in class Formatter
Holds the mapping used to determine the appropriate Transformer for each Model.
ModelMappingClass in namespace SehrGut\Laravel5_Api
$TransformerProperty in class Transformer
Stores an instance of a model_mapping to retrieve transformers for related models.
$TransformerProperty in class Transformer
Holds the eloquent instance to be transformed.

N

NotFoundClass in namespace SehrGut\Laravel5_Api\Exceptions\Http

O

$TransformerProperty in class Transformer
Holds the array form of the model.

R

$ControllerProperty in class Controller
The relations to load with the model from the DB.
$ControllerProperty in class Controller
Use this to simply override the RequestAdapter.
$ControllerProperty in class Controller
$ControllerProperty in class Controller
$ControllerProperty in class Controller
Controller::refreshResource() — Method in class Controller
Load a fresh instance of the current resource from the database.
$ModelMappingProperty in class ModelMapping
An array mapping each Eloquent Model to a route.
RequestAdapterClass in namespace SehrGut\Laravel5_Api
This basic RequestAdapter assumes the keys are part of the url or the query string and therefore available as properties of the request.
$RequestAdapterProperty in class RequestAdapter
$ValidatorProperty in class Validator
Definition of the validation rules.

S

Controller::store() — Method in class Controller
Request Handler: Create a new resource.
Controller::show() — Method in class Controller
Request Handler: Show a single resource.
$ExceptionProperty in class Exception
The HTTP status code to respond with on this exception (if applicable).
$FormatterExceptionProperty in class FormatterException
{@inheritdoc}
$InvalidDataProperty in class InvalidData
{@inheritdoc}
$HttpExceptionProperty in class HttpException
{@inheritdoc}
$NotFoundProperty in class NotFound
{@inheritdoc}
$ValidatorExceptionProperty in class ValidatorException
The HTTP status code to respond with on this exception.
Formatter::serialize() — Method in class Formatter
Turn the transformed data into a JSON string.
Transformer::serialize() — Method in class Transformer
Serialize a single record to an array.

T

Formatter::transform() — Method in class Formatter
Apply the transformer to an Eloquent Model.
$ModelMappingProperty in class ModelMapping
An array mapping each Eloquent Model to a Tansformer class.
TransformerClass in namespace SehrGut\Laravel5_Api
Responsible for applying transformations to Eloquent Models in order to customize their representation at the API.
Transformer::transform() — Method in class Transformer
Transform a single eloquent record.
Transformer::transformAny() — Method in class Transformer
Transform either Collection or Model using the known $model_mapping.

U

Controller::update() — Method in class Controller
Request Handler: Update a resource.
Controller::updateResource() — Method in class Controller
Update the resource with the input data.

V

Controller::validateInput() — Method in class Controller
Validate the input data using the appropriate validator.
ValidatorExceptionClass in namespace SehrGut\Laravel5_Api\Exceptions\Validator
$ModelMappingProperty in class ModelMapping
An array mapping each Eloquent Model to a Validator class.
ValidatorClass in namespace SehrGut\Laravel5_Api
Validator::validate() — Method in class Validator
Validate the input using $rules.

_

Controller::__construct() — Method in class Controller
ValidatorException::__construct() — Method in class ValidatorException
Formatter::__construct() — Method in class Formatter
Create a new instance.
RequestAdapter::__construct() — Method in class RequestAdapter
Transformer::__construct() — Method in class Transformer