{"owner":"Ocramius","repo":"docs","hasSkills":true,"totalSkillsCount":2,"totalTokensCount":2526,"categories":["root-instruction","cursor-rule"],"hasMcp":false,"mcpConfig":null,"found":["routing.md",".cursorrules (kubernetes-mkdocs-documentation-cursorrules-prompt.mdc)"],"skills":{"routing.md":"# Routing\n\n- [Basic Routing](#basic-routing)\n- [Route Parameters](#route-parameters)\n- [Route Filters](#route-filters)\n- [Named Routes](#named-routes)\n- [Route Groups](#route-groups)\n- [Sub-Domain Routing](#sub-domain-routing)\n- [Route Prefixing](#route-prefixing)\n- [Route Model Binding](#route-model-binding)\n- [Throwing 404 Errors](#throwing-404-errors)\n- [Routing To Controllers](#routing-to-controllers)\n\n<a name=\"basic-routing\"></a>\n## Basic Routing\n\nMost of the routes for your application will be defined in the `app/routes.php` file. The simplest Laravel routes consist of a URI and a Closure callback.\n\n#### Basic GET Route\n\n\tRoute::get('/', function()\n\t{\n\t\treturn 'Hello World';\n\t});\n\n#### Basic POST Route\n\n\tRoute::post('foo/bar', function()\n\t{\n\t\treturn 'Hello World';\n\t});\n\n#### Registering A Route For Multiple Verbs\n\n\tRoute::match(array('GET', 'POST'), '/', function()\n\t{\n\t\treturn 'Hello World';\n\t});\n\n#### Registering A Route Responding To Any HTTP Verb\n\n\tRoute::any('foo', function()\n\t{\n\t\treturn 'Hello World';\n\t});\n\n#### Forcing A Route To Be Served Over HTTPS\n\n\tRoute::get('foo', array('https', function()\n\t{\n\t\treturn 'Must be over HTTPS';\n\t}));\n\nOften, you will need to generate URLs to your routes, you may do so using the `URL::to` method:\n\n\t$url = URL::to('foo');\n\n<a name=\"route-parameters\"></a>\n## Route Parameters\n\n\tRoute::get('user/{id}', function($id)\n\t{\n\t\treturn 'User '.$id;\n\t});\n\n#### Optional Route Parameters\n\n\tRoute::get('user/{name?}', function($name = null)\n\t{\n\t\treturn $name;\n\t});\n\n#### Optional Route Parameters With Defaults\n\n\tRoute::get('user/{name?}', function($name = 'John')\n\t{\n\t\treturn $name;\n\t});\n\n#### Regular Expression Route Constraints\n\n\tRoute::get('user/{name}', function($name)\n\t{\n\t\t//\n\t})\n\t->where('name', '[A-Za-z]+');\n\n\tRoute::get('user/{id}', function($id)\n\t{\n\t\t//\n\t})\n\t->where('id', '[0-9]+');\n\n#### Passing An Array Of Wheres\n\nOf course, you may pass an array of constraints when necessary:\n\n\tRoute::get('user/{id}/{name}', function($id, $name)\n\t{\n\t\t//\n\t})\n\t->where(array('id' => '[0-9]+', 'name' => '[a-z]+'))\n\n#### Defining Global Patterns\n\nIf you would like a route parameter to always be constrained by a given regular expression, you may use the `pattern` method:\n\n\tRoute::pattern('id', '[0-9]+');\n\n\tRoute::get('user/{id}', function($id)\n\t{\n\t\t// Only called if {id} is numeric.\n\t});\n\n#### Accessing A Route Parameter Value\n\nIf you need to access a route parameter value outside of a route, you may use the `Route::input` method:\n\n\tRoute::filter('foo', function()\n\t{\n\t\tif (Route::input('id') == 1)\n\t\t{\n\t\t\t//\n\t\t}\n\t});\n\n<a name=\"route-filters\"></a>\n## Route Filters\n\nRoute filters provide a convenient way of limiting access to a given route, which is useful for creating areas of your site which require authentication. There are several filters included in the Laravel framework, including an `auth` filter, an `auth.basic` filter, a `guest` filter, and a `csrf` filter. These are located in the `app/filters.php` file.\n\n#### Defining A Route Filter\n\n\tRoute::filter('old', function()\n\t{\n\t\tif (Input::get('age') < 200)\n\t\t{\n\t\t\treturn Redirect::to('home');\n\t\t}\n\t});\n\nIf the filter returns a response, that response is considered the response to the request and the route will not execute. Any `after` filters on the route are also cancelled.\n\n#### Attaching A Filter To A Route\n\n\tRoute::get('user', array('before' => 'old', function()\n\t{\n\t\treturn 'You are over 200 years old!';\n\t}));\n\n#### Attaching A Filter To A Controller Action\n\n\tRoute::get('user', array('before' => 'old', 'uses' => 'UserController@showProfile'));\n\n#### Attaching Multiple Filters To A Route\n\n\tRoute::get('user', array('before' => 'auth|old', function()\n\t{\n\t\treturn 'You are authenticated and over 200 years old!';\n\t}));\n\n#### Attaching Multiple Filters Via Array\n\n\tRoute::get('user', array('before' => array('auth', 'old'), function()\n\t{\n\t\treturn 'You are authenticated and over 200 years old!';\n\t}));\n\n#### Specifying Filter Parameters\n\n\tRoute::filter('age', function($route, $request, $value)\n\t{\n\t\t//\n\t});\n\n\tRoute::get('user', array('before' => 'age:200', function()\n\t{\n\t\treturn 'Hello World';\n\t}));\n\nAfter filters receive a `$response` as the third argument passed to the filter:\n\n\tRoute::filter('log', function($route, $request, $response, $value)\n\t{\n\t\t//\n\t});\n\n#### Pattern Based Filters\n\nYou may also specify that a filter applies to an entire set of routes based on their URI.\n\n\tRoute::filter('admin', function()\n\t{\n\t\t//\n\t});\n\n\tRoute::when('admin/*', 'admin');\n\nIn the example above, the `admin` filter would be applied to all routes beginning with `admin/`. The asterisk is used as a wildcard, and will match any combination of characters.\n\nYou may also constrain pattern filters by HTTP verbs:\n\n\tRoute::when('admin/*', 'admin', array('post'));\n\n#### Filter Classes\n\nFor advanced filtering, you may wish to use a class instead of a Closure. Since filter classes are resolved out of the application [IoC Container](/docs/ioc), you will be able to utilize dependency injection in these filters for greater testability.\n\n#### Registering A Class Based Filter\n\n\tRoute::filter('foo', 'FooFilter');\n\nBy default, the `filter` method on the `FooFilter` class will be called:\n\n\tclass FooFilter {\n\n\t\tpublic function filter()\n\t\t{\n\t\t\t// Filter logic...\n\t\t}\n\n\t}\n\nIf you do not wish to use the `filter` method, just specify another method:\n\n\tRoute::filter('foo', 'FooFilter@foo');\n\n<a name=\"named-routes\"></a>\n## Named Routes\n\nNamed routes make referring to routes when generating redirects or URLs more convenient. You may specify a name for a route like so:\n\n\tRoute::get('user/profile', array('as' => 'profile', function()\n\t{\n\t\t//\n\t}));\n\nYou may also specify route names for controller actions:\n\n\tRoute::get('user/profile', array('as' => 'profile', 'uses' => 'UserController@showProfile'));\n\nNow, you may use the route's name when generating URLs or redirects:\n\n\t$url = URL::route('profile');\n\n\t$redirect = Redirect::route('profile');\n\nYou may access the name of a route that is running via the `currentRouteName` method:\n\n\t$name = Route::currentRouteName();\n\n<a name=\"route-groups\"></a>\n## Route Groups\n\nSometimes you may need to apply filters to a group of routes. Instead of specifying the filter on each route, you may use a route group:\n\n\tRoute::group(array('before' => 'auth'), function()\n\t{\n\t\tRoute::get('/', function()\n\t\t{\n\t\t\t// Has Auth Filter\n\t\t});\n\n\t\tRoute::get('user/profile', function()\n\t\t{\n\t\t\t// Has Auth Filter\n\t\t});\n\t});\n\nYou may also use the `namespace` parameter within your `group` array to specify all controllers within that group as being in a given namespace:\n\n\tRoute::group(array('namespace' => 'Admin'), function()\n\t{\n\t\t//\n\t});\n\n<a name=\"sub-domain-routing\"></a>\n## Sub-Domain Routing\n\nLaravel routes are also able to handle wildcard sub-domains, and pass you wildcard parameters from the domain:\n\n#### Registering Sub-Domain Routes\n\n\tRoute::group(array('domain' => '{account}.myapp.com'), function()\n\t{\n\n\t\tRoute::get('user/{id}', function($account, $id)\n\t\t{\n\t\t\t//\n\t\t});\n\n\t});\n\n<a name=\"route-prefixing\"></a>\n## Route Prefixing\n\nA group of routes may be prefixed by using the `prefix` option in the attributes array of a group:\n\n#### Prefixing Grouped Routes\n\n\tRoute::group(array('prefix' => 'admin'), function()\n\t{\n\n\t\tRoute::get('user', function()\n\t\t{\n\t\t\t//\n\t\t});\n\n\t});\n\n<a name=\"route-model-binding\"></a>\n## Route Model Binding\n\nModel binding provides a convenient way to inject model instances into your routes. For example, instead of injecting a user's ID, you can inject the entire User model instance that matches the given ID. First, use the `Route::model` method to specify the model that should be used for a given parameter:\n\n#### Binding A Parameter To A Model\n\n\tRoute::model('user', 'User');\n\nNext, define a route that contains a `{user}` parameter:\n\n\tRoute::get('profile/{user}', function(User $user)\n\t{\n\t\t//\n\t});\n\nSince we have bound the `{user}` parameter to the `User` model, a `User` instance will be injected into the route. So, for example, a request to `profile/1` will inject the `User` instance which has an ID of 1.\n\n> **Note:** If a matching model instance is not found in the database, a 404 error will be thrown.\n\nIf you wish to specify your own \"not found\" behavior, you may pass a Closure as the third argument to the `model` method:\n\n\tRoute::model('user', 'User', function()\n\t{\n\t\tthrow new NotFoundException;\n\t});\n\nSometimes you may wish to use your own resolver for route parameters. Simply use the `Route::bind` method:\n\n\tRoute::bind('user', function($value, $route)\n\t{\n\t\treturn User::where('name', $value)->first();\n\t});\n\n<a name=\"throwing-404-errors\"></a>\n## Throwing 404 Errors\n\nThere are two ways to manually trigger a 404 error from a route. First, you may use the `App::abort` method:\n\n\tApp::abort(404);\n\nSecond, you may throw an instance of `Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException`.\n\nMore information on handling 404 exceptions and using custom responses for these errors may be found in the [errors](/docs/errors#handling-404-errors) section of the documentation.\n\n<a name=\"routing-to-controllers\"></a>\n## Routing To Controllers\n\nLaravel allows you to not only route to Closures, but also to controller classes, and even allows the creation of [resource controllers](/docs/controllers#resource-controllers).\n\nSee the documentation on [Controllers](/docs/controllers) for more details.\n",".cursorrules (kubernetes-mkdocs-documentation-cursorrules-prompt.mdc)":"---\ndescription: \"Cursor rules for Kubernetes development with MkDocs documentation integration.\"\nglobs: **/*\nalwaysApply: false\n---\nYou are an expert Technical Writer with a deep understanding of cloud native technologies, Kubernetes, and technical documentation best practices. You excel at creating clear, concise, and user-friendly documentation using Markdown and MkDocs.\n\nYou always use the latest stable versions of Kubernetes, cloud native tools, and MkDocs. You're familiar with the latest features, best practices, and trends in cloud native architecture, containerization, and orchestration.\n\nDocumentation Style and Structure:\n\nCloud Native and Kubernetes Expertise:\n\nMkDocs Usage:\n\nContent Creation:\n\nTechnical Accuracy and Usability:\n\nDocumentation Best Practices:\n\nMetadata and SEO:\n\nCollaboration and Version Control:\n\nOther Rules to follow:\n\nDon't be lazy, provide thorough and accurate documentation for all requested topics and features.\n"},"files":{"routing.md":"# Routing\n\n- [Basic Routing](#basic-routing)\n- [Route Parameters](#route-parameters)\n- [Route Filters](#route-filters)\n- [Named Routes](#named-routes)\n- [Route Groups](#route-groups)\n- [Sub-Domain Routing](#sub-domain-routing)\n- [Route Prefixing](#route-prefixing)\n- [Route Model Binding](#route-model-binding)\n- [Throwing 404 Errors](#throwing-404-errors)\n- [Routing To Controllers](#routing-to-controllers)\n\n<a name=\"basic-routing\"></a>\n## Basic Routing\n\nMost of the routes for your application will be defined in the `app/routes.php` file. The simplest Laravel routes consist of a URI and a Closure callback.\n\n#### Basic GET Route\n\n\tRoute::get('/', function()\n\t{\n\t\treturn 'Hello World';\n\t});\n\n#### Basic POST Route\n\n\tRoute::post('foo/bar', function()\n\t{\n\t\treturn 'Hello World';\n\t});\n\n#### Registering A Route For Multiple Verbs\n\n\tRoute::match(array('GET', 'POST'), '/', function()\n\t{\n\t\treturn 'Hello World';\n\t});\n\n#### Registering A Route Responding To Any HTTP Verb\n\n\tRoute::any('foo', function()\n\t{\n\t\treturn 'Hello World';\n\t});\n\n#### Forcing A Route To Be Served Over HTTPS\n\n\tRoute::get('foo', array('https', function()\n\t{\n\t\treturn 'Must be over HTTPS';\n\t}));\n\nOften, you will need to generate URLs to your routes, you may do so using the `URL::to` method:\n\n\t$url = URL::to('foo');\n\n<a name=\"route-parameters\"></a>\n## Route Parameters\n\n\tRoute::get('user/{id}', function($id)\n\t{\n\t\treturn 'User '.$id;\n\t});\n\n#### Optional Route Parameters\n\n\tRoute::get('user/{name?}', function($name = null)\n\t{\n\t\treturn $name;\n\t});\n\n#### Optional Route Parameters With Defaults\n\n\tRoute::get('user/{name?}', function($name = 'John')\n\t{\n\t\treturn $name;\n\t});\n\n#### Regular Expression Route Constraints\n\n\tRoute::get('user/{name}', function($name)\n\t{\n\t\t//\n\t})\n\t->where('name', '[A-Za-z]+');\n\n\tRoute::get('user/{id}', function($id)\n\t{\n\t\t//\n\t})\n\t->where('id', '[0-9]+');\n\n#### Passing An Array Of Wheres\n\nOf course, you may pass an array of constraints when necessary:\n\n\tRoute::get('user/{id}/{name}', function($id, $name)\n\t{\n\t\t//\n\t})\n\t->where(array('id' => '[0-9]+', 'name' => '[a-z]+'))\n\n#### Defining Global Patterns\n\nIf you would like a route parameter to always be constrained by a given regular expression, you may use the `pattern` method:\n\n\tRoute::pattern('id', '[0-9]+');\n\n\tRoute::get('user/{id}', function($id)\n\t{\n\t\t// Only called if {id} is numeric.\n\t});\n\n#### Accessing A Route Parameter Value\n\nIf you need to access a route parameter value outside of a route, you may use the `Route::input` method:\n\n\tRoute::filter('foo', function()\n\t{\n\t\tif (Route::input('id') == 1)\n\t\t{\n\t\t\t//\n\t\t}\n\t});\n\n<a name=\"route-filters\"></a>\n## Route Filters\n\nRoute filters provide a convenient way of limiting access to a given route, which is useful for creating areas of your site which require authentication. There are several filters included in the Laravel framework, including an `auth` filter, an `auth.basic` filter, a `guest` filter, and a `csrf` filter. These are located in the `app/filters.php` file.\n\n#### Defining A Route Filter\n\n\tRoute::filter('old', function()\n\t{\n\t\tif (Input::get('age') < 200)\n\t\t{\n\t\t\treturn Redirect::to('home');\n\t\t}\n\t});\n\nIf the filter returns a response, that response is considered the response to the request and the route will not execute. Any `after` filters on the route are also cancelled.\n\n#### Attaching A Filter To A Route\n\n\tRoute::get('user', array('before' => 'old', function()\n\t{\n\t\treturn 'You are over 200 years old!';\n\t}));\n\n#### Attaching A Filter To A Controller Action\n\n\tRoute::get('user', array('before' => 'old', 'uses' => 'UserController@showProfile'));\n\n#### Attaching Multiple Filters To A Route\n\n\tRoute::get('user', array('before' => 'auth|old', function()\n\t{\n\t\treturn 'You are authenticated and over 200 years old!';\n\t}));\n\n#### Attaching Multiple Filters Via Array\n\n\tRoute::get('user', array('before' => array('auth', 'old'), function()\n\t{\n\t\treturn 'You are authenticated and over 200 years old!';\n\t}));\n\n#### Specifying Filter Parameters\n\n\tRoute::filter('age', function($route, $request, $value)\n\t{\n\t\t//\n\t});\n\n\tRoute::get('user', array('before' => 'age:200', function()\n\t{\n\t\treturn 'Hello World';\n\t}));\n\nAfter filters receive a `$response` as the third argument passed to the filter:\n\n\tRoute::filter('log', function($route, $request, $response, $value)\n\t{\n\t\t//\n\t});\n\n#### Pattern Based Filters\n\nYou may also specify that a filter applies to an entire set of routes based on their URI.\n\n\tRoute::filter('admin', function()\n\t{\n\t\t//\n\t});\n\n\tRoute::when('admin/*', 'admin');\n\nIn the example above, the `admin` filter would be applied to all routes beginning with `admin/`. The asterisk is used as a wildcard, and will match any combination of characters.\n\nYou may also constrain pattern filters by HTTP verbs:\n\n\tRoute::when('admin/*', 'admin', array('post'));\n\n#### Filter Classes\n\nFor advanced filtering, you may wish to use a class instead of a Closure. Since filter classes are resolved out of the application [IoC Container](/docs/ioc), you will be able to utilize dependency injection in these filters for greater testability.\n\n#### Registering A Class Based Filter\n\n\tRoute::filter('foo', 'FooFilter');\n\nBy default, the `filter` method on the `FooFilter` class will be called:\n\n\tclass FooFilter {\n\n\t\tpublic function filter()\n\t\t{\n\t\t\t// Filter logic...\n\t\t}\n\n\t}\n\nIf you do not wish to use the `filter` method, just specify another method:\n\n\tRoute::filter('foo', 'FooFilter@foo');\n\n<a name=\"named-routes\"></a>\n## Named Routes\n\nNamed routes make referring to routes when generating redirects or URLs more convenient. You may specify a name for a route like so:\n\n\tRoute::get('user/profile', array('as' => 'profile', function()\n\t{\n\t\t//\n\t}));\n\nYou may also specify route names for controller actions:\n\n\tRoute::get('user/profile', array('as' => 'profile', 'uses' => 'UserController@showProfile'));\n\nNow, you may use the route's name when generating URLs or redirects:\n\n\t$url = URL::route('profile');\n\n\t$redirect = Redirect::route('profile');\n\nYou may access the name of a route that is running via the `currentRouteName` method:\n\n\t$name = Route::currentRouteName();\n\n<a name=\"route-groups\"></a>\n## Route Groups\n\nSometimes you may need to apply filters to a group of routes. Instead of specifying the filter on each route, you may use a route group:\n\n\tRoute::group(array('before' => 'auth'), function()\n\t{\n\t\tRoute::get('/', function()\n\t\t{\n\t\t\t// Has Auth Filter\n\t\t});\n\n\t\tRoute::get('user/profile', function()\n\t\t{\n\t\t\t// Has Auth Filter\n\t\t});\n\t});\n\nYou may also use the `namespace` parameter within your `group` array to specify all controllers within that group as being in a given namespace:\n\n\tRoute::group(array('namespace' => 'Admin'), function()\n\t{\n\t\t//\n\t});\n\n<a name=\"sub-domain-routing\"></a>\n## Sub-Domain Routing\n\nLaravel routes are also able to handle wildcard sub-domains, and pass you wildcard parameters from the domain:\n\n#### Registering Sub-Domain Routes\n\n\tRoute::group(array('domain' => '{account}.myapp.com'), function()\n\t{\n\n\t\tRoute::get('user/{id}', function($account, $id)\n\t\t{\n\t\t\t//\n\t\t});\n\n\t});\n\n<a name=\"route-prefixing\"></a>\n## Route Prefixing\n\nA group of routes may be prefixed by using the `prefix` option in the attributes array of a group:\n\n#### Prefixing Grouped Routes\n\n\tRoute::group(array('prefix' => 'admin'), function()\n\t{\n\n\t\tRoute::get('user', function()\n\t\t{\n\t\t\t//\n\t\t});\n\n\t});\n\n<a name=\"route-model-binding\"></a>\n## Route Model Binding\n\nModel binding provides a convenient way to inject model instances into your routes. For example, instead of injecting a user's ID, you can inject the entire User model instance that matches the given ID. First, use the `Route::model` method to specify the model that should be used for a given parameter:\n\n#### Binding A Parameter To A Model\n\n\tRoute::model('user', 'User');\n\nNext, define a route that contains a `{user}` parameter:\n\n\tRoute::get('profile/{user}', function(User $user)\n\t{\n\t\t//\n\t});\n\nSince we have bound the `{user}` parameter to the `User` model, a `User` instance will be injected into the route. So, for example, a request to `profile/1` will inject the `User` instance which has an ID of 1.\n\n> **Note:** If a matching model instance is not found in the database, a 404 error will be thrown.\n\nIf you wish to specify your own \"not found\" behavior, you may pass a Closure as the third argument to the `model` method:\n\n\tRoute::model('user', 'User', function()\n\t{\n\t\tthrow new NotFoundException;\n\t});\n\nSometimes you may wish to use your own resolver for route parameters. Simply use the `Route::bind` method:\n\n\tRoute::bind('user', function($value, $route)\n\t{\n\t\treturn User::where('name', $value)->first();\n\t});\n\n<a name=\"throwing-404-errors\"></a>\n## Throwing 404 Errors\n\nThere are two ways to manually trigger a 404 error from a route. First, you may use the `App::abort` method:\n\n\tApp::abort(404);\n\nSecond, you may throw an instance of `Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException`.\n\nMore information on handling 404 exceptions and using custom responses for these errors may be found in the [errors](/docs/errors#handling-404-errors) section of the documentation.\n\n<a name=\"routing-to-controllers\"></a>\n## Routing To Controllers\n\nLaravel allows you to not only route to Closures, but also to controller classes, and even allows the creation of [resource controllers](/docs/controllers#resource-controllers).\n\nSee the documentation on [Controllers](/docs/controllers) for more details.\n",".cursorrules (kubernetes-mkdocs-documentation-cursorrules-prompt.mdc)":"---\ndescription: \"Cursor rules for Kubernetes development with MkDocs documentation integration.\"\nglobs: **/*\nalwaysApply: false\n---\nYou are an expert Technical Writer with a deep understanding of cloud native technologies, Kubernetes, and technical documentation best practices. You excel at creating clear, concise, and user-friendly documentation using Markdown and MkDocs.\n\nYou always use the latest stable versions of Kubernetes, cloud native tools, and MkDocs. You're familiar with the latest features, best practices, and trends in cloud native architecture, containerization, and orchestration.\n\nDocumentation Style and Structure:\n\nCloud Native and Kubernetes Expertise:\n\nMkDocs Usage:\n\nContent Creation:\n\nTechnical Accuracy and Usability:\n\nDocumentation Best Practices:\n\nMetadata and SEO:\n\nCollaboration and Version Control:\n\nOther Rules to follow:\n\nDon't be lazy, provide thorough and accurate documentation for all requested topics and features.\n"},"items":[{"name":"routing.md","path":"routing.md","rawUrl":"https://raw.githubusercontent.com/Ocramius/docs/HEAD/routing.md","title":"Multi-Agent Routing & Delegation Matrix","category":"root-instruction","format":"markdown","content":"# Routing\n\n- [Basic Routing](#basic-routing)\n- [Route Parameters](#route-parameters)\n- [Route Filters](#route-filters)\n- [Named Routes](#named-routes)\n- [Route Groups](#route-groups)\n- [Sub-Domain Routing](#sub-domain-routing)\n- [Route Prefixing](#route-prefixing)\n- [Route Model Binding](#route-model-binding)\n- [Throwing 404 Errors](#throwing-404-errors)\n- [Routing To Controllers](#routing-to-controllers)\n\n<a name=\"basic-routing\"></a>\n## Basic Routing\n\nMost of the routes for your application will be defined in the `app/routes.php` file. The simplest Laravel routes consist of a URI and a Closure callback.\n\n#### Basic GET Route\n\n\tRoute::get('/', function()\n\t{\n\t\treturn 'Hello World';\n\t});\n\n#### Basic POST Route\n\n\tRoute::post('foo/bar', function()\n\t{\n\t\treturn 'Hello World';\n\t});\n\n#### Registering A Route For Multiple Verbs\n\n\tRoute::match(array('GET', 'POST'), '/', function()\n\t{\n\t\treturn 'Hello World';\n\t});\n\n#### Registering A Route Responding To Any HTTP Verb\n\n\tRoute::any('foo', function()\n\t{\n\t\treturn 'Hello World';\n\t});\n\n#### Forcing A Route To Be Served Over HTTPS\n\n\tRoute::get('foo', array('https', function()\n\t{\n\t\treturn 'Must be over HTTPS';\n\t}));\n\nOften, you will need to generate URLs to your routes, you may do so using the `URL::to` method:\n\n\t$url = URL::to('foo');\n\n<a name=\"route-parameters\"></a>\n## Route Parameters\n\n\tRoute::get('user/{id}', function($id)\n\t{\n\t\treturn 'User '.$id;\n\t});\n\n#### Optional Route Parameters\n\n\tRoute::get('user/{name?}', function($name = null)\n\t{\n\t\treturn $name;\n\t});\n\n#### Optional Route Parameters With Defaults\n\n\tRoute::get('user/{name?}', function($name = 'John')\n\t{\n\t\treturn $name;\n\t});\n\n#### Regular Expression Route Constraints\n\n\tRoute::get('user/{name}', function($name)\n\t{\n\t\t//\n\t})\n\t->where('name', '[A-Za-z]+');\n\n\tRoute::get('user/{id}', function($id)\n\t{\n\t\t//\n\t})\n\t->where('id', '[0-9]+');\n\n#### Passing An Array Of Wheres\n\nOf course, you may pass an array of constraints when necessary:\n\n\tRoute::get('user/{id}/{name}', function($id, $name)\n\t{\n\t\t//\n\t})\n\t->where(array('id' => '[0-9]+', 'name' => '[a-z]+'))\n\n#### Defining Global Patterns\n\nIf you would like a route parameter to always be constrained by a given regular expression, you may use the `pattern` method:\n\n\tRoute::pattern('id', '[0-9]+');\n\n\tRoute::get('user/{id}', function($id)\n\t{\n\t\t// Only called if {id} is numeric.\n\t});\n\n#### Accessing A Route Parameter Value\n\nIf you need to access a route parameter value outside of a route, you may use the `Route::input` method:\n\n\tRoute::filter('foo', function()\n\t{\n\t\tif (Route::input('id') == 1)\n\t\t{\n\t\t\t//\n\t\t}\n\t});\n\n<a name=\"route-filters\"></a>\n## Route Filters\n\nRoute filters provide a convenient way of limiting access to a given route, which is useful for creating areas of your site which require authentication. There are several filters included in the Laravel framework, including an `auth` filter, an `auth.basic` filter, a `guest` filter, and a `csrf` filter. These are located in the `app/filters.php` file.\n\n#### Defining A Route Filter\n\n\tRoute::filter('old', function()\n\t{\n\t\tif (Input::get('age') < 200)\n\t\t{\n\t\t\treturn Redirect::to('home');\n\t\t}\n\t});\n\nIf the filter returns a response, that response is considered the response to the request and the route will not execute. Any `after` filters on the route are also cancelled.\n\n#### Attaching A Filter To A Route\n\n\tRoute::get('user', array('before' => 'old', function()\n\t{\n\t\treturn 'You are over 200 years old!';\n\t}));\n\n#### Attaching A Filter To A Controller Action\n\n\tRoute::get('user', array('before' => 'old', 'uses' => 'UserController@showProfile'));\n\n#### Attaching Multiple Filters To A Route\n\n\tRoute::get('user', array('before' => 'auth|old', function()\n\t{\n\t\treturn 'You are authenticated and over 200 years old!';\n\t}));\n\n#### Attaching Multiple Filters Via Array\n\n\tRoute::get('user', array('before' => array('auth', 'old'), function()\n\t{\n\t\treturn 'You are authenticated and over 200 years old!';\n\t}));\n\n#### Specifying Filter Parameters\n\n\tRoute::filter('age', function($route, $request, $value)\n\t{\n\t\t//\n\t});\n\n\tRoute::get('user', array('before' => 'age:200', function()\n\t{\n\t\treturn 'Hello World';\n\t}));\n\nAfter filters receive a `$response` as the third argument passed to the filter:\n\n\tRoute::filter('log', function($route, $request, $response, $value)\n\t{\n\t\t//\n\t});\n\n#### Pattern Based Filters\n\nYou may also specify that a filter applies to an entire set of routes based on their URI.\n\n\tRoute::filter('admin', function()\n\t{\n\t\t//\n\t});\n\n\tRoute::when('admin/*', 'admin');\n\nIn the example above, the `admin` filter would be applied to all routes beginning with `admin/`. The asterisk is used as a wildcard, and will match any combination of characters.\n\nYou may also constrain pattern filters by HTTP verbs:\n\n\tRoute::when('admin/*', 'admin', array('post'));\n\n#### Filter Classes\n\nFor advanced filtering, you may wish to use a class instead of a Closure. Since filter classes are resolved out of the application [IoC Container](/docs/ioc), you will be able to utilize dependency injection in these filters for greater testability.\n\n#### Registering A Class Based Filter\n\n\tRoute::filter('foo', 'FooFilter');\n\nBy default, the `filter` method on the `FooFilter` class will be called:\n\n\tclass FooFilter {\n\n\t\tpublic function filter()\n\t\t{\n\t\t\t// Filter logic...\n\t\t}\n\n\t}\n\nIf you do not wish to use the `filter` method, just specify another method:\n\n\tRoute::filter('foo', 'FooFilter@foo');\n\n<a name=\"named-routes\"></a>\n## Named Routes\n\nNamed routes make referring to routes when generating redirects or URLs more convenient. You may specify a name for a route like so:\n\n\tRoute::get('user/profile', array('as' => 'profile', function()\n\t{\n\t\t//\n\t}));\n\nYou may also specify route names for controller actions:\n\n\tRoute::get('user/profile', array('as' => 'profile', 'uses' => 'UserController@showProfile'));\n\nNow, you may use the route's name when generating URLs or redirects:\n\n\t$url = URL::route('profile');\n\n\t$redirect = Redirect::route('profile');\n\nYou may access the name of a route that is running via the `currentRouteName` method:\n\n\t$name = Route::currentRouteName();\n\n<a name=\"route-groups\"></a>\n## Route Groups\n\nSometimes you may need to apply filters to a group of routes. Instead of specifying the filter on each route, you may use a route group:\n\n\tRoute::group(array('before' => 'auth'), function()\n\t{\n\t\tRoute::get('/', function()\n\t\t{\n\t\t\t// Has Auth Filter\n\t\t});\n\n\t\tRoute::get('user/profile', function()\n\t\t{\n\t\t\t// Has Auth Filter\n\t\t});\n\t});\n\nYou may also use the `namespace` parameter within your `group` array to specify all controllers within that group as being in a given namespace:\n\n\tRoute::group(array('namespace' => 'Admin'), function()\n\t{\n\t\t//\n\t});\n\n<a name=\"sub-domain-routing\"></a>\n## Sub-Domain Routing\n\nLaravel routes are also able to handle wildcard sub-domains, and pass you wildcard parameters from the domain:\n\n#### Registering Sub-Domain Routes\n\n\tRoute::group(array('domain' => '{account}.myapp.com'), function()\n\t{\n\n\t\tRoute::get('user/{id}', function($account, $id)\n\t\t{\n\t\t\t//\n\t\t});\n\n\t});\n\n<a name=\"route-prefixing\"></a>\n## Route Prefixing\n\nA group of routes may be prefixed by using the `prefix` option in the attributes array of a group:\n\n#### Prefixing Grouped Routes\n\n\tRoute::group(array('prefix' => 'admin'), function()\n\t{\n\n\t\tRoute::get('user', function()\n\t\t{\n\t\t\t//\n\t\t});\n\n\t});\n\n<a name=\"route-model-binding\"></a>\n## Route Model Binding\n\nModel binding provides a convenient way to inject model instances into your routes. For example, instead of injecting a user's ID, you can inject the entire User model instance that matches the given ID. First, use the `Route::model` method to specify the model that should be used for a given parameter:\n\n#### Binding A Parameter To A Model\n\n\tRoute::model('user', 'User');\n\nNext, define a route that contains a `{user}` parameter:\n\n\tRoute::get('profile/{user}', function(User $user)\n\t{\n\t\t//\n\t});\n\nSince we have bound the `{user}` parameter to the `User` model, a `User` instance will be injected into the route. So, for example, a request to `profile/1` will inject the `User` instance which has an ID of 1.\n\n> **Note:** If a matching model instance is not found in the database, a 404 error will be thrown.\n\nIf you wish to specify your own \"not found\" behavior, you may pass a Closure as the third argument to the `model` method:\n\n\tRoute::model('user', 'User', function()\n\t{\n\t\tthrow new NotFoundException;\n\t});\n\nSometimes you may wish to use your own resolver for route parameters. Simply use the `Route::bind` method:\n\n\tRoute::bind('user', function($value, $route)\n\t{\n\t\treturn User::where('name', $value)->first();\n\t});\n\n<a name=\"throwing-404-errors\"></a>\n## Throwing 404 Errors\n\nThere are two ways to manually trigger a 404 error from a route. First, you may use the `App::abort` method:\n\n\tApp::abort(404);\n\nSecond, you may throw an instance of `Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException`.\n\nMore information on handling 404 exceptions and using custom responses for these errors may be found in the [errors](/docs/errors#handling-404-errors) section of the documentation.\n\n<a name=\"routing-to-controllers\"></a>\n## Routing To Controllers\n\nLaravel allows you to not only route to Closures, but also to controller classes, and even allows the creation of [resource controllers](/docs/controllers#resource-controllers).\n\nSee the documentation on [Controllers](/docs/controllers) for more details.\n","isInternal":false,"tokens":2353,"sizeBytes":9399},{"name":".cursorrules","path":".cursorrules (kubernetes-mkdocs-documentation-cursorrules-prompt.mdc)","rawUrl":"https://raw.githubusercontent.com/PatrickJS/awesome-cursorrules/main/rules/kubernetes-mkdocs-documentation-cursorrules-prompt.mdc","title":"Awesome Cursorrules: kubernetes mkdocs documentation cursorrules prompt","category":"cursor-rule","format":"markdown","content":"---\ndescription: \"Cursor rules for Kubernetes development with MkDocs documentation integration.\"\nglobs: **/*\nalwaysApply: false\n---\nYou are an expert Technical Writer with a deep understanding of cloud native technologies, Kubernetes, and technical documentation best practices. You excel at creating clear, concise, and user-friendly documentation using Markdown and MkDocs.\n\nYou always use the latest stable versions of Kubernetes, cloud native tools, and MkDocs. You're familiar with the latest features, best practices, and trends in cloud native architecture, containerization, and orchestration.\n\nDocumentation Style and Structure:\n\nCloud Native and Kubernetes Expertise:\n\nMkDocs Usage:\n\nContent Creation:\n\nTechnical Accuracy and Usability:\n\nDocumentation Best Practices:\n\nMetadata and SEO:\n\nCollaboration and Version Control:\n\nOther Rules to follow:\n\nDon't be lazy, provide thorough and accurate documentation for all requested topics and features.\n","tokens":173,"sizeBytes":957}],"systemPromptSnippet":"<yakaai_skills repo=\"Ocramius/docs\">\n<!-- File: routing.md (Tokens: ~2353 | Category: root-instruction) -->\n# Routing\n\n- [Basic Routing](#basic-routing)\n- [Route Parameters](#route-parameters)\n- [Route Filters](#route-filters)\n- [Named Routes](#named-routes)\n- [Route Groups](#route-groups)\n- [Sub-Domain Routing](#sub-domain-routing)\n- [Route Prefixing](#route-prefixing)\n- [Route Model Binding](#route-model-binding)\n- [Throwing 404 Errors](#throwing-404-errors)\n- [Routing To Controllers](#routing-to-controllers)\n\n<a name=\"basic-routing\"></a>\n## Basic Routing\n\nMost of the routes for your application will be defined in the `app/routes.php` file. The simplest Laravel routes consist of a URI and a Closure callback.\n\n#### Basic GET Route\n\n\tRoute::get('/', function()\n\t{\n\t\treturn 'Hello World';\n\t});\n\n#### Basic POST Route\n\n\tRoute::post('foo/bar', function()\n\t{\n\t\treturn 'Hello World';\n\t});\n\n#### Registering A Route For Multiple Verbs\n\n\tRoute::match(array('GET', 'POST'), '/', function()\n\t{\n\t\treturn 'Hello World';\n\t});\n\n#### Registering A Route Responding To Any HTTP Verb\n\n\tRoute::any('foo', function()\n\t{\n\t\treturn 'Hello World';\n\t});\n\n#### Forcing A Route To Be Served Over HTTPS\n\n\tRoute::get('foo', array('https', function()\n\t{\n\t\treturn 'Must be over HTTPS';\n\t}));\n\nOften, you will need to generate URLs to your routes, you may do so using the `URL::to` method:\n\n\t$url = URL::to('foo');\n\n<a name=\"route-parameters\"></a>\n## Route Parameters\n\n\tRoute::get('user/{id}', function($id)\n\t{\n\t\treturn 'User '.$id;\n\t});\n\n#### Optional Route Parameters\n\n\tRoute::get('user/{name?}', function($name = null)\n\t{\n\t\treturn $name;\n\t});\n\n#### Optional Route Parameters With Defaults\n\n\tRoute::get('user/{name?}', function($name = 'John')\n\t{\n\t\treturn $name;\n\t});\n\n#### Regular Expression Route Constraints\n\n\tRoute::get('user/{name}', function($name)\n\t{\n\t\t//\n\t})\n\t->where('name', '[A-Za-z]+');\n\n\tRoute::get('user/{id}', function($id)\n\t{\n\t\t//\n\t})\n\t->where('id', '[0-9]+');\n\n#### Passing An Array Of Wheres\n\nOf course, you may pass an array of constraints when necessary:\n\n\tRoute::get('user/{id}/{name}', function($id, $name)\n\t{\n\t\t//\n\t})\n\t->where(array('id' => '[0-9]+', 'name' => '[a-z]+'))\n\n#### Defining Global Patterns\n\nIf you would like a route parameter to always be constrained by a given regular expression, you may use the `pattern` method:\n\n\tRoute::pattern('id', '[0-9]+');\n\n\tRoute::get('user/{id}', function($id)\n\t{\n\t\t// Only called if {id} is numeric.\n\t});\n\n#### Accessing A Route Parameter Value\n\nIf you need to access a route parameter value outside of a route, you may use the `Route::input` method:\n\n\tRoute::filter('foo', function()\n\t{\n\t\tif (Route::input('id') == 1)\n\t\t{\n\t\t\t//\n\t\t}\n\t});\n\n<a name=\"route-filters\"></a>\n## Route Filters\n\nRoute filters provide a convenient way of limiting access to a given route, which is useful for creating areas of your site which require authentication. There are several filters included in the Laravel framework, including an `auth` filter, an `auth.basic` filter, a `guest` filter, and a `csrf` filter. These are located in the `app/filters.php` file.\n\n#### Defining A Route Filter\n\n\tRoute::filter('old', function()\n\t{\n\t\tif (Input::get('age') < 200)\n\t\t{\n\t\t\treturn Redirect::to('home');\n\t\t}\n\t});\n\nIf the filter returns a response, that response is considered the response to the request and the route will not execute. Any `after` filters on the route are also cancelled.\n\n#### Attaching A Filter To A Route\n\n\tRoute::get('user', array('before' => 'old', function()\n\t{\n\t\treturn 'You are over 200 years old!';\n\t}));\n\n#### Attaching A Filter To A Controller Action\n\n\tRoute::get('user', array('before' => 'old', 'uses' => 'UserController@showProfile'));\n\n#### Attaching Multiple Filters To A Route\n\n\tRoute::get('user', array('before' => 'auth|old', function()\n\t{\n\t\treturn 'You are authenticated and over 200 years old!';\n\t}));\n\n#### Attaching Multiple Filters Via Array\n\n\tRoute::get('user', array('before' => array('auth', 'old'), function()\n\t{\n\t\treturn 'You are authenticated and over 200 years old!';\n\t}));\n\n#### Specifying Filter Parameters\n\n\tRoute::filter('age', function($route, $request, $value)\n\t{\n\t\t//\n\t});\n\n\tRoute::get('user', array('before' => 'age:200', function()\n\t{\n\t\treturn 'Hello World';\n\t}));\n\nAfter filters receive a `$response` as the third argument passed to the filter:\n\n\tRoute::filter('log', function($route, $request, $response, $value)\n\t{\n\t\t//\n\t});\n\n#### Pattern Based Filters\n\nYou may also specify that a filter applies to an entire set of routes based on their URI.\n\n\tRoute::filter('admin', function()\n\t{\n\t\t//\n\t});\n\n\tRoute::when('admin/*', 'admin');\n\nIn the example above, the `admin` filter would be applied to all routes beginning with `admin/`. The asterisk is used as a wildcard, and will match any combination of characters.\n\nYou may also constrain pattern filters by HTTP verbs:\n\n\tRoute::when('admin/*', 'admin', array('post'));\n\n#### Filter Classes\n\nFor advanced filtering, you may wish to use a class instead of a Closure. Since filter classes are resolved out of the application [IoC Container](/docs/ioc), you will be able to utilize dependency injection in these filters for greater testability.\n\n#### Registering A Class Based Filter\n\n\tRoute::filter('foo', 'FooFilter');\n\nBy default, the `filter` method on the `FooFilter` class will be called:\n\n\tclass FooFilter {\n\n\t\tpublic function filter()\n\t\t{\n\t\t\t// Filter logic...\n\t\t}\n\n\t}\n\nIf you do not wish to use the `filter` method, just specify another method:\n\n\tRoute::filter('foo', 'FooFilter@foo');\n\n<a name=\"named-routes\"></a>\n## Named Routes\n\nNamed routes make referring to routes when generating redirects or URLs more convenient. You may specify a name for a route like so:\n\n\tRoute::get('user/profile', array('as' => 'profile', function()\n\t{\n\t\t//\n\t}));\n\nYou may also specify route names for controller actions:\n\n\tRoute::get('user/profile', array('as' => 'profile', 'uses' => 'UserController@showProfile'));\n\nNow, you may use the route's name when generating URLs or redirects:\n\n\t$url = URL::route('profile');\n\n\t$redirect = Redirect::route('profile');\n\nYou may access the name of a route that is running via the `currentRouteName` method:\n\n\t$name = Route::currentRouteName();\n\n<a name=\"route-groups\"></a>\n## Route Groups\n\nSometimes you may need to apply filters to a group of routes. Instead of specifying the filter on each route, you may use a route group:\n\n\tRoute::group(array('before' => 'auth'), function()\n\t{\n\t\tRoute::get('/', function()\n\t\t{\n\t\t\t// Has Auth Filter\n\t\t});\n\n\t\tRoute::get('user/profile', function()\n\t\t{\n\t\t\t// Has Auth Filter\n\t\t});\n\t});\n\nYou may also use the `namespace` parameter within your `group` array to specify all controllers within that group as being in a given namespace:\n\n\tRoute::group(array('namespace' => 'Admin'), function()\n\t{\n\t\t//\n\t});\n\n<a name=\"sub-domain-routing\"></a>\n## Sub-Domain Routing\n\nLaravel routes are also able to handle wildcard sub-domains, and pass you wildcard parameters from the domain:\n\n#### Registering Sub-Domain Routes\n\n\tRoute::group(array('domain' => '{account}.myapp.com'), function()\n\t{\n\n\t\tRoute::get('user/{id}', function($account, $id)\n\t\t{\n\t\t\t//\n\t\t});\n\n\t});\n\n<a name=\"route-prefixing\"></a>\n## Route Prefixing\n\nA group of routes may be prefixed by using the `prefix` option in the attributes array of a group:\n\n#### Prefixing Grouped Routes\n\n\tRoute::group(array('prefix' => 'admin'), function()\n\t{\n\n\t\tRoute::get('user', function()\n\t\t{\n\t\t\t//\n\t\t});\n\n\t});\n\n<a name=\"route-model-binding\"></a>\n## Route Model Binding\n\nModel binding provides a convenient way to inject model instances into your routes. For example, instead of injecting a user's ID, you can inject the entire User model instance that matches the given ID. First, use the `Route::model` method to specify the model that should be used for a given parameter:\n\n#### Binding A Parameter To A Model\n\n\tRoute::model('user', 'User');\n\nNext, define a route that contains a `{user}` parameter:\n\n\tRoute::get('profile/{user}', function(User $user)\n\t{\n\t\t//\n\t});\n\nSince we have bound the `{user}` parameter to the `User` model, a `User` instance will be injected into the route. So, for example, a request to `profile/1` will inject the `User` instance which has an ID of 1.\n\n> **Note:** If a matching model instance is not found in the database, a 404 error will be thrown.\n\nIf you wish to specify your own \"not found\" behavior, you may pass a Closure as the third argument to the `model` method:\n\n\tRoute::model('user', 'User', function()\n\t{\n\t\tthrow new NotFoundException;\n\t});\n\nSometimes you may wish to use your own resolver for route parameters. Simply use the `Route::bind` method:\n\n\tRoute::bind('user', function($value, $route)\n\t{\n\t\treturn User::where('name', $value)->first();\n\t});\n\n<a name=\"throwing-404-errors\"></a>\n## Throwing 404 Errors\n\nThere are two ways to manually trigger a 404 error from a route. First, you may use the `App::abort` method:\n\n\tApp::abort(404);\n\nSecond, you may throw an instance of `Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException`.\n\nMore information on handling 404 exceptions and using custom responses for these errors may be found in the [errors](/docs/errors#handling-404-errors) section of the documentation.\n\n<a name=\"routing-to-controllers\"></a>\n## Routing To Controllers\n\nLaravel allows you to not only route to Closures, but also to controller classes, and even allows the creation of [resource controllers](/docs/controllers#resource-controllers).\n\nSee the documentation on [Controllers](/docs/controllers) for more details.\n\n<!-- File: .cursorrules (kubernetes-mkdocs-documentation-cursorrules-prompt.mdc) (Tokens: ~173 | Category: cursor-rule) -->\n---\ndescription: \"Cursor rules for Kubernetes development with MkDocs documentation integration.\"\nglobs: **/*\nalwaysApply: false\n---\nYou are an expert Technical Writer with a deep understanding of cloud native technologies, Kubernetes, and technical documentation best practices. You excel at creating clear, concise, and user-friendly documentation using Markdown and MkDocs.\n\nYou always use the latest stable versions of Kubernetes, cloud native tools, and MkDocs. You're familiar with the latest features, best practices, and trends in cloud native architecture, containerization, and orchestration.\n\nDocumentation Style and Structure:\n\nCloud Native and Kubernetes Expertise:\n\nMkDocs Usage:\n\nContent Creation:\n\nTechnical Accuracy and Usability:\n\nDocumentation Best Practices:\n\nMetadata and SEO:\n\nCollaboration and Version Control:\n\nOther Rules to follow:\n\nDon't be lazy, provide thorough and accurate documentation for all requested topics and features.\n</yakaai_skills>"}