Skip to content

Troubleshooting

merlosy edited this page Aug 4, 2014 · 2 revisions

Request to {object}

Laravel offers the possibility to inject model objects in the controller methods:

  1. First, bind the route to the model in your routes.php (example of User).

  2. When you build your request, you need to set the object id field (integer for SQL) or _id field (string for MongoDB) where the {object} is.

  3. Then, it will search for the user in the database and inject it in the controller (as a User object). (For example: .../v1/users/55/show) If the object identifier is not found, you will get a 404 response message.

logged_in filter

Using this filter makes sure the user uses as valid access token to access the route. The access token is returned to you as the key field at the end of the authentication.

Clone this wiki locally