{"id":23219198,"url":"https://github.com/solutionforest/filament-access-management","last_synced_at":"2025-04-06T19:10:50.005Z","repository":{"id":154104419,"uuid":"619401570","full_name":"solutionforest/filament-access-management","owner":"solutionforest","description":"This is total different concept on handle role and permission. A RBAC permission control through spatie/laravel-permission.","archived":false,"fork":false,"pushed_at":"2025-02-28T09:11:58.000Z","size":1027,"stargazers_count":83,"open_issues_count":0,"forks_count":21,"subscribers_count":5,"default_branch":"2.x","last_synced_at":"2025-03-30T18:07:50.286Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://spatie.be/docs/laravel-permission/v5/introduction","language":"PHP","has_issues":false,"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/solutionforest.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","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":"2023-03-27T04:16:44.000Z","updated_at":"2025-03-04T21:19:18.000Z","dependencies_parsed_at":"2023-11-22T05:23:56.299Z","dependency_job_id":"5fa44ed8-774e-4fe0-a001-146acb97216d","html_url":"https://github.com/solutionforest/filament-access-management","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/solutionforest%2Ffilament-access-management","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solutionforest%2Ffilament-access-management/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solutionforest%2Ffilament-access-management/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solutionforest%2Ffilament-access-management/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solutionforest","download_url":"https://codeload.github.com/solutionforest/filament-access-management/tar.gz/refs/heads/2.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247535516,"owners_count":20954576,"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-12-18T21:20:07.187Z","updated_at":"2025-04-06T19:10:49.986Z","avatar_url":"https://github.com/solutionforest.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# filament-access-management\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/solution-forest/filament-access-management.svg?style=flat-square)](https://packagist.org/packages/solution-forest/filament-access-management)\n[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/solution-forest/filament-access-management/run-tests?label=tests)](https://github.com/solution-forest/filament-access-management/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/solution-forest/filament-access-management/Check%20\u0026%20fix%20styling?label=code%20style)](https://github.com/solution-forest/filament-access-management/actions?query=workflow%3A\"Check+%26+fix+styling\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/solution-forest/filament-access-management.svg?style=flat-square)](https://packagist.org/packages/solution-forest/filament-access-management)\n\n\nThis is an authentication plugin for Filament Admin with Laravel-permission\n\n## Installation\n\n1. Ensure you have already installed the Filament panel.\n2. You can install the package via composer:\n    ```bash\n    composer require solution-forest/filament-access-management\n    ```\n    \n3. Add the necessary trait to your User model:\n\n    ```php\n\n    use SolutionForest\\FilamentAccessManagement\\Concerns\\FilamentUserHelpers;\n\n    class User extends Authenticatable\n    {\n        use FilamentUserHelpers;\n    }\n    ```\n    \n4. **Clear your config cache**:\n   ```bash\n    php artisan optimize:clear\n    # or\n    php artisan config:clear\n   ```\n\n5. Register the plugin in your Panel provider:\n   \u003e **Important:  Register the plugin in your Panel provider after version 2.x**\n   ``` bash\n    use SolutionForest\\FilamentAccessManagement\\FilamentAccessManagementPanel;\n \n    public function panel(Panel $panel): Panel\n    {\n        return $panel\n            -\u003eplugin(FilamentAccessManagementPanel::make());\n    }\n   ```\n\n6. Then execute the following commands:\n   ```bash\n   php artisan filament-access-management:install\n   ```\n   If you don't already have a user named `admin`, this command creates a **Super Admin User** with the following credentials:\n\n    - Name: admin\n    - E-mail address: admin@(\"slug\" pattern from config(\"app.name\")).com\n    - Password: admin\n\n    You can also create the super admin user with:\n\n    ```bash\n    php artisan make:super-admin-user\n    ```\n\n6. Call upgrade command to upgrade data after version **2.2.0**\n    ```bash\n    php artisan filament-access-management:upgrade\n    ```\n\n\n## Publish Configs, Views, Translations and Migrations\n\nYou can publish the configs, views, translations and migrations with:\n\n```bash\nphp artisan vendor:publish --tag=\"filament-access-management-config\"\n\nphp artisan vendor:publish --tag=\"filament-access-management-views\"\n\nphp artisan vendor:publish --tag=\"filament-access-management-translations\"\n\nphp artisan vendor:publish --tag=\"filament-access-management-migrations\"\n```\n\n## Migration\n\n```bash\nphp artisan migrate\n```\n\n## Usage\n\nUpon installation, \"Menu\", \"Users\", \"Roles\" and \"Permissions\" pages will be created. Each user have roles and each role have permissions.\n\n![image](https://user-images.githubusercontent.com/73818060/232434966-91ab94fe-620a-4894-8632-dbe5e535e5ae.png)\n\nManage Menu:\n![image](https://user-images.githubusercontent.com/73818060/232438118-0b4089e7-4ff0-40b8-93b1-c6d4c089ef14.png)\n\nManage Users and their roles:\n![image](https://user-images.githubusercontent.com/73818060/232437828-73039db1-8976-4a23-a14d-2943d9495a47.png)\n![image](https://user-images.githubusercontent.com/73818060/232437890-2db887e1-dcbb-4d96-b072-365720be66d7.png)\n\nManage Roles and their permissions:\n![image](https://user-images.githubusercontent.com/73818060/232438496-002b56d6-db98-4672-82cc-efcfc06fba9e.png)\n![image](https://user-images.githubusercontent.com/73818060/232438548-29b655bc-d683-4924-90b7-6ba25991d7ff.png)\n\nManage Permissions:\n![image](https://user-images.githubusercontent.com/73818060/232438632-e5d9a5e5-7ef5-4ca5-a330-37948acd9748.png)\n![image](https://user-images.githubusercontent.com/73818060/232438719-fc2bca0b-7233-4aae-bf87-9c1d8524e42d.png)\n\n## Routing control\n\nIn this plugin, permissions and routes are bound together, set the routes that the current permissions can access in the edit permissions page, select the method to access the routes in the `HTTP method` select box, and fill in the path that can be accessed in the `HTTP path`.\n\nFor example, if you want to add a permission, which can access the path `/admin/users` by `GET`, then `HTTP method` select `GET`, and `HTTP path` fill in `/users`.\n\n\nIf you want to access all the paths prefixed with `/admin/users`, then `HTTP path` fill in `/users*`; if you want to access the edit page, then `HTTP path` fill in `/users/*/edit`; if the method of each path in multiple paths is different, then `HTTP path` fill in `GET:users/*'. `.\n\n\nIf the above method is not sufficient, `HTTP path` also supports **routing aliases**, such as `admin.users.show`.\n\n## Super Administrator\n\nCreate super admin user:\n\n```bash\n\nphp artisan make:super-admin-user\n\n```\n\nCheck permission:\n```bash\n\n# Check by permission's name\n\\SolutionForest\\FilamentAccessManagement\\Http\\Auth\\Permission::check($name)\n\n# Check by http_path\n\\SolutionForest\\FilamentAccessManagement\\Http\\Auth\\Permission::checkPermission($path)\n\n```\n\nGet current user:\n``` bash\n\n\\SolutionForest\\FilamentAccessManagement\\Facades\\FilamentAuthenticate::user();\n\n```\n\n## Advance Usage\n\nIn default, the menu created will co-exist with the original menu of filament. To override the original menu with the menu from this package, modify `/config/filament-access-management.php` as following:\n\n1. Set ```filament.navigation.enabled =\u003e true```\n\n``` php\n\n    'filament' =\u003e [\n        ...\n        'navigation' =\u003e [\n            /**\n             * Using db based filament navigation if true.\n             */\n            'enabled' =\u003e true,\n            /**\n             * Table name db based filament navigation.\n             */\n            'table_name' =\u003e 'filament_menu',\n            /**\n             * Filament Menu Model.\n             */\n            'model' =\u003e Models\\Menu::class,\n        ]\n        ...\n    ]\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](.github/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- [Carly](https://github.com/n/a)\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%2Fsolutionforest%2Ffilament-access-management","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolutionforest%2Ffilament-access-management","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolutionforest%2Ffilament-access-management/lists"}