Skip to content
Favre Anael edited this page May 17, 2016 · 4 revisions

Status

return $this->response()->success($message = null)
return $this->response()->fail($message = null)
return $this->response()->warning($message = null)
return $this->response()->error($message = null)

Set the status of the action (browser : flash a Laracast/Flash message into the session, Ajax : return a status into a JSend response).

Views

return $this->response()->view($view, array $bind = [])

Return a view for a browser response

Redirections

return $this->response()->redirect($url)

Return a redirection for a browser response.

Eloquent Model

return $this->response()->item(Model $model)

Format an eloquent model with his Transformer and put it into data offset of a Ajax JSend response.

Eloquent Collection

return $this->response()->collection(Collection $collection)

Format an eloquent collection with his Transformer and put it into data offset of a Ajax JSend response.

Datas

return $this->response()->datas($datas)

Manually specify the data offset content of the Ajax JSend response.

Metas

return $this->response()->metas(array $metas)

Add metas into the Ajax JSend response.

Clone this wiki locally