Methods summary
public
|
#
__construct( mixed $content, integer $status = 200, array $headers = array() )
Create a new response instance.
Create a new response instance.
Parameters
- $content
mixed $content
- $status
integer $status
- $headers
array $headers
|
public static
Laravel\Response
|
#
make( mixed $content, integer $status = 200, array $headers = array() )
Create a new response instance.
Create a new response instance.
return Response::make(json_encode($user));
return Response::make('Not Found', 404);
return Response::make(json_encode($user), 200, array('header' => 'value'));
Parameters
- $content
mixed $content
- $status
integer $status
- $headers
array $headers
Returns
|
public static
Laravel\Response
|
#
view( string $view, array $data = array() )
Create a new response instance containing a view.
Create a new response instance containing a view.
return Response::view('home.index');
return Response::view('home.index', array('name' => 'Taylor'));
Parameters
- $view
string $view
- $data
array $data
Returns
|
public static
Laravel\Response
|
#
json( mixed $data, integer $status = 200, array $headers = array(), integer $json_options = 0 )
Create a new JSON response.
Create a new JSON response.
return Response::json($data, 200, array('header' => 'value'));
Parameters
- $data
mixed $data
- $status
integer $status
- $headers
array $headers
- $json_options
integer $json_options
Returns
|
public static
Laravel\Response
|
#
jsonp( mixed $callback, integer $data, array $status = 200, mixed $headers = array() )
Create a new JSONP response.
Create a new JSONP response.
return Response::jsonp('myFunctionCall', $data, 200, array('header' => 'value'));
Parameters
- $callback
mixed $data
- $data
integer $status
- $status
array $headers
- $headers
Returns
|
public static
Laravel\Response
|
#
eloquent( Eloquent|array $data, integer $status = 200, array $headers = array() )
Create a new response of JSON'd Eloquent models.
Create a new response of JSON'd Eloquent models.
return Response::eloquent($data, 200, array('header' => 'value'));
Parameters
- $data
Eloquent|array $data
- $status
integer $status
- $headers
array $headers
Returns
|
public static
Laravel\Response
|
#
error( integer $code, array $data = array() )
Create a new error response instance.
Create a new error response instance.
The response status code will be set using the specified code.
The specified error should match a view in your views/error directory.
return Response::error('404');
return Response::error('404', array('message' => 'Not Found'));
Parameters
- $code
integer $code
- $data
array $data
Returns
|
public static
Laravel\Response
|
#
download( string $path, string $name = null, array $headers = array() )
Create a new download response instance.
Create a new download response instance.
return Response::download('path/to/file.jpg');
return Response::download('path/to/file.jpg', 'your_file.jpg');
Parameters
- $path
string $path
- $name
string $name
- $headers
array $headers
Returns
|
public
string
|
#
disposition( string $file )
Create the proper Content-Disposition header.
Create the proper Content-Disposition header.
Parameters
Returns
string
|
public static
Laravel\Response
|
#
prepare( mixed $response )
Prepare a response from the given value.
Prepare a response from the given value.
Parameters
Returns
|
public
|
#
send( )
Send the headers and content of the response to the browser.
Send the headers and content of the response to the browser.
|
public
string
|
#
render( )
Convert the content of the Response to a string and return it.
Convert the content of the Response to a string and return it.
Returns
string
|
protected
|
#
cookies( )
Set the cookies on the HttpFoundation Response.
Set the cookies on the HttpFoundation Response.
|
public
mixed
|
#
status( integer $status = null )
Get / set the response status code.
Get / set the response status code.
Parameters
Returns
mixed
|
public
string
|
#
__toString( )
Render the response when cast to string
Render the response when cast to string
Returns
string
|