{"id":32635816,"url":"https://github.com/nylo-core/laravel-nylo-auth","last_synced_at":"2026-04-02T18:02:07.935Z","repository":{"id":209156720,"uuid":"722956528","full_name":"nylo-core/laravel-nylo-auth","owner":"nylo-core","description":"Laravel authentication package for Nylo apps, provides a simple way to handle basic auth using Sanctum.","archived":false,"fork":false,"pushed_at":"2026-03-29T08:58:44.000Z","size":46,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-29T11:13:42.460Z","etag":null,"topics":["auth","authentication","laravel","nylo"],"latest_commit_sha":null,"homepage":"https://nylo.dev","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/nylo-core.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"agordn52"}},"created_at":"2023-11-24T10:46:36.000Z","updated_at":"2026-03-29T08:58:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"78bd057c-47cc-4684-9e7b-050c90953cdd","html_url":"https://github.com/nylo-core/laravel-nylo-auth","commit_stats":null,"previous_names":["nylo-core/laravel-nylo-auth"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/nylo-core/laravel-nylo-auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nylo-core%2Flaravel-nylo-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nylo-core%2Flaravel-nylo-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nylo-core%2Flaravel-nylo-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nylo-core%2Flaravel-nylo-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nylo-core","download_url":"https://codeload.github.com/nylo-core/laravel-nylo-auth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nylo-core%2Flaravel-nylo-auth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31312744,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["auth","authentication","laravel","nylo"],"created_at":"2025-10-31T00:58:36.024Z","updated_at":"2026-04-02T18:02:07.925Z","avatar_url":"https://github.com/nylo-core.png","language":"PHP","funding_links":["https://github.com/sponsors/agordn52"],"categories":[],"sub_categories":[],"readme":"# Mobile App Authentication for Laravel\n\nThis package provides API authentication endpoints for [Nylo](https://nylo.dev) Flutter apps, powered by Laravel Sanctum.\n\nCheck out the Flutter package here: [laravel_auth_slate](https://pub.dev/packages/laravel_auth_slate)\n\n## Requirements\n\n- PHP ^8.1\n- Laravel 10, 11, 12, or 13\n- Laravel Sanctum\n- Your `User` model must use the `HasApiTokens` trait:\n\n```php\nuse Laravel\\Sanctum\\HasApiTokens;\n\nclass User extends Authenticatable\n{\n    use HasApiTokens, Notifiable;\n    // ...\n}\n```\n\n## Installation\n\n```bash\ncomposer require nylo/laravel-nylo-auth\n```\n\nPublish the config and controllers:\n\n```bash\nphp artisan vendor:publish --provider=\"Nylo\\LaravelNyloAuth\\LaravelNyloAuthServiceProvider\"\n```\n\nThis publishes:\n- `config/laravel-nylo-auth.php`\n- `app/Http/Controllers/AuthController.php`\n- `app/Http/Controllers/ApiController.php`\n\n## API Endpoints\n\nAll routes are prefixed with `/app/v1`.\n\n| Method | URI | Name | Description |\n|--------|-----|------|-------------|\n| POST | `/app/v1/login` | `nylo.api.v1.login` | Login and receive a Sanctum token |\n| POST | `/app/v1/register` | `nylo.api.v1.register` | Register a new user and receive a token |\n| POST | `/app/v1/forgot-password` | `nylo.api.v1.forgot-password` | Send a password reset link |\n| GET | `/app/v1/user` | `nylo.api.v1.auth.user` | Get the authenticated user (requires Sanctum token) |\n\n## Configuration\n\n```php\n// config/laravel-nylo-auth.php\n\nreturn [\n    // The Eloquent model used for authentication\n    'user_model' =\u003e \\App\\Models\\User::class,\n\n    // Rate limiter classes for each route group\n    'rate_limits' =\u003e [\n        'public' =\u003e \\Nylo\\LaravelNyloAuth\\RateLimiters\\PublicRateLimiter::class,         // 5 req/min by IP\n        'authenticated' =\u003e \\Nylo\\LaravelNyloAuth\\RateLimiters\\AuthenticatedRateLimiter::class, // 60 req/min by user\n    ],\n];\n```\n\n## Rate Limiting\n\nRate limiting is applied to all routes via named Laravel rate limiters:\n\n- **`nylo-public`** — applies to login, register, and forgot-password (default: 5 requests/min per IP)\n- **`nylo-auth`** — applies to authenticated routes (default: 60 requests/min per user)\n\n### Custom Rate Limiters\n\nCreate a class that implements `RateLimiterContract` and update the config:\n\n```php\nuse Nylo\\LaravelNyloAuth\\Contracts\\RateLimiterContract;\nuse Illuminate\\Cache\\RateLimiting\\Limit;\n\nclass MyPublicRateLimiter implements RateLimiterContract\n{\n    public function configure(): Limit|array\n    {\n        return Limit::perMinute(10)-\u003eby(request()-\u003eip())-\u003eresponse(function () {\n            return response()-\u003ejson(['message' =\u003e 'Too many requests'], 429);\n        });\n    }\n}\n```\n\nThen in `config/laravel-nylo-auth.php`:\n\n```php\n'rate_limits' =\u003e [\n    'public' =\u003e \\App\\RateLimiters\\MyPublicRateLimiter::class,\n    'authenticated' =\u003e \\Nylo\\LaravelNyloAuth\\RateLimiters\\AuthenticatedRateLimiter::class,\n],\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Anthony Gordon](https://github.com/agordn52)\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%2Fnylo-core%2Flaravel-nylo-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnylo-core%2Flaravel-nylo-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnylo-core%2Flaravel-nylo-auth/lists"}