{"id":21466583,"url":"https://github.com/permafrost-dev/laravel-current-route","last_synced_at":"2026-05-22T05:13:36.089Z","repository":{"id":57037883,"uuid":"281514613","full_name":"permafrost-dev/laravel-current-route","owner":"permafrost-dev","description":"Laravel helper functions and classes related to the current/active route.","archived":false,"fork":false,"pushed_at":"2020-07-22T16:55:12.000Z","size":16,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-23T15:32:00.280Z","etag":null,"topics":["laravel","laravel-package","laravel-routes"],"latest_commit_sha":null,"homepage":"","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/permafrost-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-21T22:09:03.000Z","updated_at":"2020-07-24T07:36:13.000Z","dependencies_parsed_at":"2022-08-24T06:41:02.966Z","dependency_job_id":null,"html_url":"https://github.com/permafrost-dev/laravel-current-route","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permafrost-dev%2Flaravel-current-route","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permafrost-dev%2Flaravel-current-route/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permafrost-dev%2Flaravel-current-route/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permafrost-dev%2Flaravel-current-route/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/permafrost-dev","download_url":"https://codeload.github.com/permafrost-dev/laravel-current-route/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243982135,"owners_count":20378606,"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":["laravel","laravel-package","laravel-routes"],"created_at":"2024-11-23T08:14:38.646Z","updated_at":"2026-05-22T05:13:31.056Z","avatar_url":"https://github.com/permafrost-dev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Laravel Current Route\n\n---\nHelper functions and class to retrieve information about the current route in Laravel.\n\n\n![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/permafrost-dev/laravel-current-route?label=version\u0026sort=semver\u0026style=flat-square)\n\n---\n\n#### Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require permafrost-dev/laravel-current-route\n```\n---\n\n#### Helper Functions\n\n```php \n\n// Return a Laravel Route object for the current route.\nfunction current_route();\n\n// Return a class containing information about the current route.\nfunction current_route_info();\n\n// Return the action for the current route.\nfunction current_route_action();\n\n// Return true if one of the specified wildcard patterns matches the name of the current route.\nfunction current_route_matches($patterns);\n\n// Return the name for the current route.\nfunction current_route_name();\n\n// Returns true if $name matches the name of the current route.\nfunction current_route_named($name);\n```\n\n#### Usage\n\n_WIP_\n\n#### Examples\n\nUse `current_route_named()` to generate conditional css classes in a blade template:\n```html\n\u003ca class=\"{{ current_route_named('dashboard') ? 'active' : 'inactive' }}\"\n    href=\"{{ route('dashboard') }}\"\u003eDashboard\n\u003c/a\u003e\n```\n\n---\n\n#### Testing\n\n``` bash\n$ vendor/bin/phpunit\n```\n\n---\n\n#### License\n\nThe MIT License (MIT). Please see the [License File](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermafrost-dev%2Flaravel-current-route","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpermafrost-dev%2Flaravel-current-route","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermafrost-dev%2Flaravel-current-route/lists"}