Registrar.php 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. namespace Illuminate\Contracts\Routing;
  3. interface Registrar
  4. {
  5. /**
  6. * Register a new GET route with the router.
  7. *
  8. * @param string $uri
  9. * @param \Closure|array|string $action
  10. * @return \Illuminate\Routing\Route
  11. */
  12. public function get($uri, $action);
  13. /**
  14. * Register a new POST route with the router.
  15. *
  16. * @param string $uri
  17. * @param \Closure|array|string $action
  18. * @return \Illuminate\Routing\Route
  19. */
  20. public function post($uri, $action);
  21. /**
  22. * Register a new PUT route with the router.
  23. *
  24. * @param string $uri
  25. * @param \Closure|array|string $action
  26. * @return \Illuminate\Routing\Route
  27. */
  28. public function put($uri, $action);
  29. /**
  30. * Register a new DELETE route with the router.
  31. *
  32. * @param string $uri
  33. * @param \Closure|array|string $action
  34. * @return \Illuminate\Routing\Route
  35. */
  36. public function delete($uri, $action);
  37. /**
  38. * Register a new PATCH route with the router.
  39. *
  40. * @param string $uri
  41. * @param \Closure|array|string $action
  42. * @return \Illuminate\Routing\Route
  43. */
  44. public function patch($uri, $action);
  45. /**
  46. * Register a new OPTIONS route with the router.
  47. *
  48. * @param string $uri
  49. * @param \Closure|array|string $action
  50. * @return \Illuminate\Routing\Route
  51. */
  52. public function options($uri, $action);
  53. /**
  54. * Register a new route with the given verbs.
  55. *
  56. * @param array|string $methods
  57. * @param string $uri
  58. * @param \Closure|array|string $action
  59. * @return \Illuminate\Routing\Route
  60. */
  61. public function match($methods, $uri, $action);
  62. /**
  63. * Route a resource to a controller.
  64. *
  65. * @param string $name
  66. * @param string $controller
  67. * @param array $options
  68. * @return \Illuminate\Routing\PendingResourceRegistration
  69. */
  70. public function resource($name, $controller, array $options = []);
  71. /**
  72. * Create a route group with shared attributes.
  73. *
  74. * @param array $attributes
  75. * @param \Closure|string $routes
  76. * @return void
  77. */
  78. public function group(array $attributes, $routes);
  79. /**
  80. * Substitute the route bindings onto the route.
  81. *
  82. * @param \Illuminate\Routing\Route $route
  83. * @return \Illuminate\Routing\Route
  84. */
  85. public function substituteBindings($route);
  86. /**
  87. * Substitute the implicit Eloquent model bindings for the route.
  88. *
  89. * @param \Illuminate\Routing\Route $route
  90. * @return void
  91. */
  92. public function substituteImplicitBindings($route);
  93. }