{"id":37234208,"url":"https://github.com/akunbeben/fortify-role","last_synced_at":"2026-01-15T03:58:01.467Z","repository":{"id":56943525,"uuid":"363640212","full_name":"akunbeben/fortify-role","owner":"akunbeben","description":"Multi Roles authentication package for Fortify.","archived":true,"fork":false,"pushed_at":"2021-05-17T20:59:47.000Z","size":52,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-09T00:17:47.957Z","etag":null,"topics":["auth","authentication","fortify","hacktoberfest","laravel","laravel-package","laravel-ui","multi-authentication","roles"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/akunbeben/fortify-role","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/akunbeben.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":"2021-05-02T11:59:53.000Z","updated_at":"2024-01-03T10:13:54.000Z","dependencies_parsed_at":"2022-08-21T07:50:43.263Z","dependency_job_id":null,"html_url":"https://github.com/akunbeben/fortify-role","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/akunbeben/fortify-role","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akunbeben%2Ffortify-role","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akunbeben%2Ffortify-role/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akunbeben%2Ffortify-role/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akunbeben%2Ffortify-role/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akunbeben","download_url":"https://codeload.github.com/akunbeben/fortify-role/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akunbeben%2Ffortify-role/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28419274,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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","fortify","hacktoberfest","laravel","laravel-package","laravel-ui","multi-authentication","roles"],"created_at":"2026-01-15T03:58:00.755Z","updated_at":"2026-01-15T03:58:01.459Z","avatar_url":"https://github.com/akunbeben.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003ca href=\"https://laravel.com\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg\" width=\"400\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n# Fortify Role\nBasic Multi Roles authentication package for Fortify.\n\n[![GitHub license](https://img.shields.io/github/license/akunbeben/fortify-role?style=for-the-badge)](https://github.com/akunbeben/fortify-role/blob/master/LICENSE)\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/akunbeben/fortify-role/tests?style=for-the-badge)](https://github.com/akunbeben/fortify-role)\n[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/akunbeben/fortify-role?label=version\u0026style=for-the-badge)](https://github.com/akunbeben/fortify-role)\n\n## Requirement\n- Laravel ^8.x\n- Laravel/Fortify ^1.x\n\n## Installation\nI recommended you to install this package only on a fresh project.\n\nInstall the package using composer\n```\ncomposer require akunbeben/fortify-role\n```\n\n## Usage\nBefore continuing the process, please make sure the `FortifyServiceProvider.php` is registered in `config/app.php`. If it's already registered, you can skip this.\n\n```php\n'providers' =\u003e [\n    ...\n    App\\Providers\\FortifyServiceProvider::class,\n],\n```\nThen publish the package's vendor files. It's need `--force` because it will replace the `RedirectIfAuthenticated` middleware.\n```\nphp artisan vendor:publish --provider=\"Akunbeben\\FortifyRole\\FortifyRoleServiceProvider\" --force\n```\nAnd then, add `HasRole` traits to your `User` model.\n```php\n\u003c?php\n\nnamespace App\\Models;\n\nuse Akunbeben\\FortifyRole\\Traits\\HasRole;\n...\n\nclass User extends Authenticatable\n{\n    use HasFactory, Notifiable, HasRole;\n    ...\n}\n```\nNow you need to run the migration, I suggest to migrate with the seeder. Or if you want to modify the seeder you can find the seeder file on `database/seeders/RoleSeeder.php` and `database/seeders/UserSeeder.php`\n```\nphp artisan migrate --seed\n```\nFinally, you can use the `role` middleware in your routes like this example below:\n```php\n...\nRoute::group(['middleware' =\u003e ['auth', 'role:admin']], function () {\n    \n});\n\nRoute::group(['middleware' =\u003e ['auth', 'role:user']], function () {\n    \n});\n```\n\n### Notes\n- On the roles table migration file, there is a default value to assign the role to registered user. You can adjust it to your need.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakunbeben%2Ffortify-role","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakunbeben%2Ffortify-role","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakunbeben%2Ffortify-role/lists"}