Input.php 2.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. namespace Illuminate\Support\Facades;
  3. /**
  4. * @method static \Illuminate\Http\Request instance()
  5. * @method static string method()
  6. * @method static string root()
  7. * @method static string url()
  8. * @method static string fullUrl()
  9. * @method static string fullUrlWithQuery(array $query)
  10. * @method static string path()
  11. * @method static string decodedPath()
  12. * @method static string|null segment(int $index, string|null $default = null)
  13. * @method static array segments()
  14. * @method static bool is(...$patterns)
  15. * @method static bool routeIs(...$patterns)
  16. * @method static bool fullUrlIs(...$patterns)
  17. * @method static bool ajax()
  18. * @method static bool pjax()
  19. * @method static bool secure()
  20. * @method static string ip()
  21. * @method static array ips()
  22. * @method static string userAgent()
  23. * @method static \Illuminate\Http\Request merge(array $input)
  24. * @method static \Illuminate\Http\Request replace(array $input)
  25. * @method static \Symfony\Component\HttpFoundation\ParameterBag|mixed json(string $key = null, $default = null)
  26. * @method static \Illuminate\Session\Store session()
  27. * @method static \Illuminate\Session\Store|null getSession()
  28. * @method static void setLaravelSession(\Illuminate\Contracts\Session\Session $session)
  29. * @method static mixed user(string|null $guard = null)
  30. * @method static \Illuminate\Routing\Route|object|string route(string|null $param = null)
  31. * @method static string fingerprint()
  32. * @method static \Illuminate\Http\Request setJson(\Symfony\Component\HttpFoundation\ParameterBag $json)
  33. * @method static \Closure getUserResolver()
  34. * @method static \Illuminate\Http\Request setUserResolver(\Closure $callback)
  35. * @method static \Closure getRouteResolver()
  36. * @method static \Illuminate\Http\Request setRouteResolver(\Closure $callback)
  37. * @method static array toArray()
  38. * @method static bool offsetExists(string $offset)
  39. * @method static mixed offsetGet(string $offset)
  40. * @method static void offsetSet(string $offset, $value)
  41. * @method static void offsetUnset(string $offset)
  42. *
  43. * @see \Illuminate\Http\Request
  44. */
  45. class Input extends Facade
  46. {
  47. /**
  48. * Get an item from the input data.
  49. *
  50. * This method is used for all request verbs (GET, POST, PUT, and DELETE)
  51. *
  52. * @param string $key
  53. * @param mixed $default
  54. * @return mixed
  55. */
  56. public static function get($key = null, $default = null)
  57. {
  58. return static::$app['request']->input($key, $default);
  59. }
  60. /**
  61. * Get the registered name of the component.
  62. *
  63. * @return string
  64. */
  65. protected static function getFacadeAccessor()
  66. {
  67. return 'request';
  68. }
  69. }