Index
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.
- $Transformer — Property 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
- Controller — Class in namespace SehrGut\Laravel5_Api
- The main Controler to inherit from.
- $Controller — Property 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.
- $Formatter — Property in class Formatter
- The Content-Type this Formatter returns.
- $Formatter — Property 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.
- $ModelMapping — Property in class ModelMapping
- The default Transformer to use if none specified.
- $ModelMapping — Property in class ModelMapping
- The default Validator to use if none specified.
- $Transformer — Property in class Transformer
- Name the attributes that shall be omitted from the output.
- $Transformer — Property in class Transformer
- Name the relations that shall be omitted from the output.
- Transformer::dropAttributes() — Method in class Transformer
E
- Exception — Class 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
- $Controller — Property in class Controller
- Use this to simply override the Formatter.
- $Controller — Property 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.
- FormatterException — Class in namespace SehrGut\Laravel5_Api\Exceptions\Formatter
- $ValidatorException — Property in class ValidatorException
- Holds the validation errors.
- Formatter — Class 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
- HttpException — Class 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
- $Controller — Property in class Controller
- Controller::index() — Method in class Controller
- Request Handler: List all resources.
- InvalidData — Class in namespace SehrGut\Laravel5_Api\Exceptions\Formatter
- InvalidInput — Class in namespace SehrGut\Laravel5_Api\Exceptions\Validator
J
- JsonapiFormatter — Class in namespace SehrGut\Laravel5_Api\Formatters
K
- $Controller — Property in class Controller
- Maps request parameters to database columns.
M
- $Controller — Property in class Controller
- Use this to simply override the ModelMapping.
- $Controller — Property in class Controller
- $Controller — Property 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.
- $Exception — Property in class Exception
- The error message displayed to the user.
- $FormatterException — Property in class FormatterException
- {@inheritdoc}
- $InvalidData — Property in class InvalidData
- {@inheritdoc}
- $HttpException — Property in class HttpException
- {@inheritdoc}
- $NotFound — Property in class NotFound
- {@inheritdoc}
- $ValidatorException — Property in class ValidatorException
- The error message displayed to the user.
- $Formatter — Property in class Formatter
- Holds the mapping used to determine the appropriate Transformer for each Model.
- ModelMapping — Class in namespace SehrGut\Laravel5_Api
- $Transformer — Property in class Transformer
- Stores an instance of a model_mapping to retrieve transformers for related models.
- $Transformer — Property in class Transformer
- Holds the eloquent instance to be transformed.
N
- NotFound — Class in namespace SehrGut\Laravel5_Api\Exceptions\Http
O
- $Transformer — Property in class Transformer
- Holds the array form of the model.
R
- $Controller — Property in class Controller
- The relations to load with the model from the DB.
- $Controller — Property in class Controller
- Use this to simply override the RequestAdapter.
- $Controller — Property in class Controller
- $Controller — Property in class Controller
- $Controller — Property in class Controller
- Controller::refreshResource() — Method in class Controller
- Load a fresh instance of the current resource from the database.
- $ModelMapping — Property in class ModelMapping
- An array mapping each Eloquent Model to a route.
- RequestAdapter — Class 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.
- $RequestAdapter — Property in class RequestAdapter
- $Validator — Property 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.
- $Exception — Property in class Exception
- The HTTP status code to respond with on this exception (if applicable).
- $FormatterException — Property in class FormatterException
- {@inheritdoc}
- $InvalidData — Property in class InvalidData
- {@inheritdoc}
- $HttpException — Property in class HttpException
- {@inheritdoc}
- $NotFound — Property in class NotFound
- {@inheritdoc}
- $ValidatorException — Property 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.
- $ModelMapping — Property in class ModelMapping
- An array mapping each Eloquent Model to a Tansformer class.
- Transformer — Class 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.
- ValidatorException — Class in namespace SehrGut\Laravel5_Api\Exceptions\Validator
- $ModelMapping — Property in class ModelMapping
- An array mapping each Eloquent Model to a Validator class.
- Validator — Class 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