{"id":14986464,"url":"https://github.com/scalar/laravel","last_synced_at":"2025-04-11T20:32:27.634Z","repository":{"id":256222678,"uuid":"854625463","full_name":"scalar/laravel","owner":"scalar","description":"Scalar OpenAPI References in Laravel","archived":false,"fork":false,"pushed_at":"2025-03-24T12:19:38.000Z","size":1400,"stargazers_count":20,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T12:36:58.492Z","etag":null,"topics":["laravel","openapi","scalar","swagger","swagger-ui"],"latest_commit_sha":null,"homepage":"https://github.com/scalar/scalar","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/scalar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-09T13:59:29.000Z","updated_at":"2025-03-24T12:19:41.000Z","dependencies_parsed_at":"2025-03-24T12:29:14.582Z","dependency_job_id":"5a5c018b-3a72-43c5-958f-cc989cb45968","html_url":"https://github.com/scalar/laravel","commit_stats":{"total_commits":496,"total_committers":122,"mean_commits":4.065573770491803,"dds":0.6411290322580645,"last_synced_commit":"03aa027ca59cde3caf805e133485c2153c789540"},"previous_names":["scalar/laravel"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalar%2Flaravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalar%2Flaravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalar%2Flaravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalar%2Flaravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scalar","download_url":"https://codeload.github.com/scalar/laravel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248476494,"owners_count":21110293,"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","openapi","scalar","swagger","swagger-ui"],"created_at":"2024-09-24T14:12:54.796Z","updated_at":"2025-04-11T20:32:22.905Z","avatar_url":"https://github.com/scalar.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scalar for Laravel\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/scalar/laravel.svg?style=flat)](https://packagist.org/packages/scalar/laravel)\n[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/scalar/laravel/run-tests.yml?branch=main\u0026label=tests\u0026style=flat)](https://github.com/scalar/laravel/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/scalar/laravel/fix-php-code-style-issues.yml?branch=main\u0026label=code%20style\u0026style=flat)](https://github.com/scalar/laravel/actions?query=workflow%3A\"Fix+PHP+code+style+issues\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/scalar/laravel.svg?style=flat)](https://packagist.org/packages/scalar/laravel)\n\nUse your OpenAPI documents to render modern API references in Laravel\n\n![Screenshot of a Laravel-themed API reference](.github/screenshot.png)\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require scalar/laravel\n```\n\nYou can publish the config file with:\n\n```bash\nphp artisan vendor:publish --tag=\"scalar-config\"\n```\n\nOptionally, you can publish the views using\n\n```bash\nphp artisan vendor:publish --tag=\"scalar-views\"\n```\n\n## Usage\n\nYou’ll need an OpenAPI/Swagger document to render your API reference with Scalar. Here are some packages that help generating those documents:\n\n* [knuckleswtf/scribe](https://github.com/knuckleswtf/scribe)\n* [dedoc/scramble](https://github.com/dedoc/scramble)\n* [vyuldashev/laravel-openapi](https://github.com/vyuldashev/laravel-openapi)\n\nOnce done, you can pass it to Scalar. Just make sure it’s a publicly accessible URL.\n\n```php\n\u003c?php\n\n// config/scalar.php\n\nreturn [\n    // …\n\n    'url' =\u003e '/openapi.yaml',\n\n    // …\n]\n```\n\n## Authorization\n\nThe Scalar API reference may be accessed via the /scalar route. By default, everyone will be able to access this route. However, within your App\\Providers\\AppServiceProvider.php file, you can overwrite the gate definition. This authorization gate controls access to Scalar in non-local environments. You are free to modify this gate as needed to restrict access to your Horizon installation:\n\n```php\n\u003c?php\n\nnamespace App\\Providers;\n\nuse Illuminate\\Support\\Facades\\Gate;\nuse Illuminate\\Support\\ServiceProvider;\n\nclass AppServiceProvider extends ServiceProvider\n{\n    public function boot(): void\n    {\n        Gate::define('viewScalar', function ($user) {\n            return in_array($user-\u003eemail, [\n                //\n            ]);\n        });\n    }\n}\n```\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nContributions are welcome.\n\n## Credits\n\n- [Hans Pagel](https://github.com/hanspagel)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalar%2Flaravel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscalar%2Flaravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalar%2Flaravel/lists"}