{"id":16728222,"url":"https://github.com/grummfy/laravel-route-controller","last_synced_at":"2025-07-11T14:33:15.621Z","repository":{"id":62512957,"uuid":"120431300","full_name":"Grummfy/laravel-route-controller","owner":"Grummfy","description":"Define Router::controller() without breaking everything","archived":false,"fork":false,"pushed_at":"2018-02-06T10:15:31.000Z","size":7,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-18T09:39:41.249Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Grummfy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-06T09:25:30.000Z","updated_at":"2018-04-26T16:49:33.000Z","dependencies_parsed_at":"2022-11-02T13:16:46.730Z","dependency_job_id":null,"html_url":"https://github.com/Grummfy/laravel-route-controller","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Grummfy%2Flaravel-route-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Grummfy%2Flaravel-route-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Grummfy%2Flaravel-route-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Grummfy%2Flaravel-route-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Grummfy","download_url":"https://codeload.github.com/Grummfy/laravel-route-controller/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225732635,"owners_count":17515525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T23:09:10.162Z","updated_at":"2024-11-21T13:18:50.509Z","avatar_url":"https://github.com/Grummfy.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel route controller\n\nThis library like other existing, give a way to deal with `Router::controller`.\nThe key features:\n* allow caching of route\n* doesn't require extra manipulation\n* allow inheritance of route group\n* namespace independent\n\nCompatible with laravel 5.5. (probably compatible with older version too).\n\n## Install\n\nInstall the dependencies\n```\ncomposer require grummfy/laravel-route-controller\n```\n\nPublish the configuration\n```\nphp artisan vendor:publish --tag=config --provider=Grummfy\\LaravelRouteController\\RouteControllerProvider\n```\n\n## Usage\n\nOnce the package is install and autodiscover (or you have added the provider manually), the package is ready to use.\n\nIn your route file, just do this:\n```\nRoute::controller('/foo', \\App\\Http\\Controllers\\FooController::class);\n```\nIt will take all the public method from the class (including traits) and convert it to route.\n\nThere is a third argument that you can use to add extra option, like a middleware or anything else.\n```\nRoute::controller('/foo', \\App\\Http\\Controllers\\FooController::class, ['middleware' =\u003e 'can:baz']);\n```\n\nYou got also an extra option, to don't allow heritance of methods from parent:\n\n```\nRoute::controller('/foo', \\App\\Http\\Controllers\\FooController::class, ['middleware' =\u003e 'can:baz', 'heritage' =\u003e false]);\n```\n\n### Example\n\nImagine that we have the class FooController (see [example](example/FooController.php)), in this case we will have a series of method that will be converted to routes:\n* index() -\u003e /foo, foo.index\n* getStatus(string $status) -\u003e /foo/status/{status}, foo.status.post\n* postStatus(string $status) -\u003e /foo/status/{status}, foo.status.get\n* foo() -\u003e /foo/foo, foo.foo\n* my() -\u003e /foo/my, foo.my\n\n## TODO\n* unit test\n* QA tools\n  * travis\n  * styleci\n  * scrutinizer\n  * ...\n\n## Alternative\n\n* https://github.com/lesichkovm/laravel-advanced-route\n* https://github.com/themsaid/laravel-routes-publisher\n* https://github.com/shrimpwagon/laravel-route-controller\n* https://www.larablocks.com/package/eightyfive/laravel-autoroute\n* https://gist.github.com/cotcotquedec/df15f9111e5c8d118ac270f6a157c460\n* ...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrummfy%2Flaravel-route-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrummfy%2Flaravel-route-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrummfy%2Flaravel-route-controller/lists"}