123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- <?php
-
- namespace Illuminate\Contracts\Routing;
-
- interface ResponseFactory
- {
- /**
- * Return a new response from the application.
- *
- * @param string $content
- * @param int $status
- * @param array $headers
- * @return \Illuminate\Http\Response
- */
- public function make($content = '', $status = 200, array $headers = []);
-
- /**
- * Return a new view response from the application.
- *
- * @param string $view
- * @param array $data
- * @param int $status
- * @param array $headers
- * @return \Illuminate\Http\Response
- */
- public function view($view, $data = [], $status = 200, array $headers = []);
-
- /**
- * Return a new JSON response from the application.
- *
- * @param string|array $data
- * @param int $status
- * @param array $headers
- * @param int $options
- * @return \Illuminate\Http\JsonResponse
- */
- public function json($data = [], $status = 200, array $headers = [], $options = 0);
-
- /**
- * Return a new JSONP response from the application.
- *
- * @param string $callback
- * @param string|array $data
- * @param int $status
- * @param array $headers
- * @param int $options
- * @return \Illuminate\Http\JsonResponse
- */
- public function jsonp($callback, $data = [], $status = 200, array $headers = [], $options = 0);
-
- /**
- * Return a new streamed response from the application.
- *
- * @param \Closure $callback
- * @param int $status
- * @param array $headers
- * @return \Symfony\Component\HttpFoundation\StreamedResponse
- */
- public function stream($callback, $status = 200, array $headers = []);
-
- /**
- * Return a new streamed response as a file download from the application.
- *
- * @param \Closure $callback
- * @param string|null $name
- * @param array $headers
- * @param string|null $disposition
- * @return \Symfony\Component\HttpFoundation\StreamedResponse
- */
- public function streamDownload($callback, $name = null, array $headers = [], $disposition = 'attachment');
-
- /**
- * Create a new file download response.
- *
- * @param \SplFileInfo|string $file
- * @param string|null $name
- * @param array $headers
- * @param string|null $disposition
- * @return \Symfony\Component\HttpFoundation\BinaryFileResponse
- */
- public function download($file, $name = null, array $headers = [], $disposition = 'attachment');
-
- /**
- * Create a new redirect response to the given path.
- *
- * @param string $path
- * @param int $status
- * @param array $headers
- * @param bool|null $secure
- * @return \Illuminate\Http\RedirectResponse
- */
- public function redirectTo($path, $status = 302, $headers = [], $secure = null);
-
- /**
- * Create a new redirect response to a named route.
- *
- * @param string $route
- * @param array $parameters
- * @param int $status
- * @param array $headers
- * @return \Illuminate\Http\RedirectResponse
- */
- public function redirectToRoute($route, $parameters = [], $status = 302, $headers = []);
-
- /**
- * Create a new redirect response to a controller action.
- *
- * @param string $action
- * @param array $parameters
- * @param int $status
- * @param array $headers
- * @return \Illuminate\Http\RedirectResponse
- */
- public function redirectToAction($action, $parameters = [], $status = 302, $headers = []);
-
- /**
- * Create a new redirect response, while putting the current URL in the session.
- *
- * @param string $path
- * @param int $status
- * @param array $headers
- * @param bool|null $secure
- * @return \Illuminate\Http\RedirectResponse
- */
- public function redirectGuest($path, $status = 302, $headers = [], $secure = null);
-
- /**
- * Create a new redirect response to the previously intended location.
- *
- * @param string $default
- * @param int $status
- * @param array $headers
- * @param bool|null $secure
- * @return \Illuminate\Http\RedirectResponse
- */
- public function redirectToIntended($default = '/', $status = 302, $headers = [], $secure = null);
- }
|