PHP Class Response, someline-starter

Show file Open project: someline/someline-starter Class Usage Examples

Public Methods

Method Description
download ( SplFileInfo | string $file, string $name = null, array $headers = [], string | null $disposition = 'attachment' ) : BinaryFileResponse Create a new file download response.
file ( SplFileInfo | string $file, array $headers = [] ) : BinaryFileResponse Return the raw contents of a binary file.
hasMacro ( string $name ) : boolean Checks if macro is registered.
json ( string | array $data = [], integer $status = 200, array $headers = [], integer $options ) : Illuminate\Http\JsonResponse Return a new JSON response from the application.
jsonp ( string $callback, string | array $data = [], integer $status = 200, array $headers = [], integer $options ) : Illuminate\Http\JsonResponse Return a new JSONP response from the application.
macro ( string $name, callable $macro ) : void Register a custom macro.
make ( string $content = '', integer $status = 200, array $headers = [] ) : Illuminate\Http\Response Return a new response from the application.
redirectGuest ( string $path, integer $status = 302, array $headers = [], boolean | null $secure = null ) : Illuminate\Http\RedirectResponse Create a new redirect response, while putting the current URL in the session.
redirectTo ( string $path, integer $status = 302, array $headers = [], boolean | null $secure = null ) : Illuminate\Http\RedirectResponse Create a new redirect response to the given path.
redirectToAction ( string $action, array $parameters = [], integer $status = 302, array $headers = [] ) : Illuminate\Http\RedirectResponse Create a new redirect response to a controller action.
redirectToIntended ( string $default = '/', integer $status = 302, array $headers = [], boolean | null $secure = null ) : Illuminate\Http\RedirectResponse Create a new redirect response to the previously intended location.
redirectToRoute ( string $route, array $parameters = [], integer $status = 302, array $headers = [] ) : Illuminate\Http\RedirectResponse Create a new redirect response to a named route.
stream ( Closure $callback, integer $status = 200, array $headers = [] ) : Symfony\Component\HttpFoundation\StreamedResponse Return a new streamed response from the application.
view ( string $view, array $data = [], integer $status = 200, array $headers = [] ) : Illuminate\Http\Response Return a new view response from the application.

Method Details

download() public static method

Create a new file download response.
public static download ( SplFileInfo | string $file, string $name = null, array $headers = [], string | null $disposition = 'attachment' ) : BinaryFileResponse
$file SplFileInfo | string
$name string
$headers array
$disposition string | null
return Symfony\Component\HttpFoundation\BinaryFileResponse

file() public static method

Return the raw contents of a binary file.
public static file ( SplFileInfo | string $file, array $headers = [] ) : BinaryFileResponse
$file SplFileInfo | string
$headers array
return Symfony\Component\HttpFoundation\BinaryFileResponse

hasMacro() public static method

Checks if macro is registered.
public static hasMacro ( string $name ) : boolean
$name string
return boolean

json() public static method

Return a new JSON response from the application.
public static json ( string | array $data = [], integer $status = 200, array $headers = [], integer $options ) : Illuminate\Http\JsonResponse
$data string | array
$status integer
$headers array
$options integer
return Illuminate\Http\JsonResponse

jsonp() public static method

Return a new JSONP response from the application.
public static jsonp ( string $callback, string | array $data = [], integer $status = 200, array $headers = [], integer $options ) : Illuminate\Http\JsonResponse
$callback string
$data string | array
$status integer
$headers array
$options integer
return Illuminate\Http\JsonResponse

macro() public static method

Register a custom macro.
public static macro ( string $name, callable $macro ) : void
$name string
$macro callable
return void

make() public static method

Return a new response from the application.
public static make ( string $content = '', integer $status = 200, array $headers = [] ) : Illuminate\Http\Response
$content string
$status integer
$headers array
return Illuminate\Http\Response

redirectGuest() public static method

Create a new redirect response, while putting the current URL in the session.
public static redirectGuest ( string $path, integer $status = 302, array $headers = [], boolean | null $secure = null ) : Illuminate\Http\RedirectResponse
$path string
$status integer
$headers array
$secure boolean | null
return Illuminate\Http\RedirectResponse

redirectTo() public static method

Create a new redirect response to the given path.
public static redirectTo ( string $path, integer $status = 302, array $headers = [], boolean | null $secure = null ) : Illuminate\Http\RedirectResponse
$path string
$status integer
$headers array
$secure boolean | null
return Illuminate\Http\RedirectResponse

redirectToAction() public static method

Create a new redirect response to a controller action.
public static redirectToAction ( string $action, array $parameters = [], integer $status = 302, array $headers = [] ) : Illuminate\Http\RedirectResponse
$action string
$parameters array
$status integer
$headers array
return Illuminate\Http\RedirectResponse

redirectToIntended() public static method

Create a new redirect response to the previously intended location.
public static redirectToIntended ( string $default = '/', integer $status = 302, array $headers = [], boolean | null $secure = null ) : Illuminate\Http\RedirectResponse
$default string
$status integer
$headers array
$secure boolean | null
return Illuminate\Http\RedirectResponse

redirectToRoute() public static method

Create a new redirect response to a named route.
public static redirectToRoute ( string $route, array $parameters = [], integer $status = 302, array $headers = [] ) : Illuminate\Http\RedirectResponse
$route string
$parameters array
$status integer
$headers array
return Illuminate\Http\RedirectResponse

stream() public static method

Return a new streamed response from the application.
public static stream ( Closure $callback, integer $status = 200, array $headers = [] ) : Symfony\Component\HttpFoundation\StreamedResponse
$callback Closure
$status integer
$headers array
return Symfony\Component\HttpFoundation\StreamedResponse

view() public static method

Return a new view response from the application.
public static view ( string $view, array $data = [], integer $status = 200, array $headers = [] ) : Illuminate\Http\Response
$view string
$data array
$status integer
$headers array
return Illuminate\Http\Response