{"id":19029998,"url":"https://github.com/padosoft/laravel-permission-extended","last_synced_at":"2026-06-19T08:02:20.057Z","repository":{"id":95268991,"uuid":"191801236","full_name":"padosoft/laravel-permission-extended","owner":"padosoft","description":"Extension of spatie/laravel-permission with event firing when permissions or roles are assigned or removed","archived":false,"fork":false,"pushed_at":"2025-08-07T09:52:53.000Z","size":57,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-03-25T07:29:15.947Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/padosoft.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-13T16:53:50.000Z","updated_at":"2024-06-04T08:57:36.000Z","dependencies_parsed_at":"2024-06-03T16:48:45.493Z","dependency_job_id":"8695e759-d6b3-4b57-a612-a459ff95ab1f","html_url":"https://github.com/padosoft/laravel-permission-extended","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/padosoft/laravel-permission-extended","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padosoft%2Flaravel-permission-extended","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padosoft%2Flaravel-permission-extended/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padosoft%2Flaravel-permission-extended/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padosoft%2Flaravel-permission-extended/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/padosoft","download_url":"https://codeload.github.com/padosoft/laravel-permission-extended/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padosoft%2Flaravel-permission-extended/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34522042,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-08T21:16:04.820Z","updated_at":"2026-06-19T08:02:19.993Z","avatar_url":"https://github.com/padosoft.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# laravel-permission-extended\nExtension of spatie/laravel-permission with event firing when permissions or roles are assigned or removed\n\n* [Installation](#installation)\n* [Usage](#usage)\n\nThis package use spatie/laravel-permission and allows to manage user permissions and roles in a database.\n\nIt also fire specific events when a permission or role is assigned or revoked.  \n\n## Installation\n\nThis package can be used in Laravel 5.4 or higher.\n\nYou can install the package via composer:\n``` bash\ncomposer require padosoft/laravel-permission-extended\n```\n\nIn Laravel 5.5 the service provider will automatically get registered. In older versions of the framework just add the service provider in `config/app.php` file:\n```php\n'providers' =\u003e [\n    // ...\n    Spatie\\Permission\\PermissionServiceProvider::class,\n    Padosoft\\Laravel\\PermissionExtended\\PermissionExtendedServiceProvider::class,\n];\n```\nThen publish and run migrations :\n\n```bash\nphp artisan vendor:publish --provider=\"Spatie\\Permission\\PermissionServiceProvider\" --tag=\"migrations\"\n```\n\n```bash\nphp artisan migrate\n```\nPublish configs :\n```bash\nphp artisan vendor:publish --provider=\"Spatie\\Permission\\PermissionServiceProvider\" --tag=\"config\"\n```\n```bash\nphp artisan vendor:publish --provider=\"Padosoft\\Laravel\\PermissionExtended\\PermissionExtendedServiceProvider\" --tag=\"config\"\n```\nWhen published, open the `config/permission.php` config file and change it to uses\nthis package's specific models \n```php\nreturn [\n    'models' =\u003e [\n\n        /*\n         * When using the \"HasRoles\" trait from this package, we need to know which\n         * Eloquent model should be used to retrieve your permissions. Of course, it\n         * is often just the \"Permission\" model but you may use whatever you like.\n         *\n         * The model you want to use as a Permission model needs to implement the\n         * `Spatie\\Permission\\Contracts\\Permission` contract.\n         */\n\n        'permission' =\u003e Padosoft\\Laravel\\PermissionExtended\\Models\\Permission::class,\n\n        /*\n         * When using the \"HasRoles\" trait from this package, we need to know which\n         * Eloquent model should be used to retrieve your roles. Of course, it\n         * is often just the \"Role\" model but you may use whatever you like.\n         *\n         * The model you want to use as a Role model needs to implement the\n         * `Spatie\\Permission\\Contracts\\Role` contract.\n         */\n\n        'role' =\u003e Padosoft\\Laravel\\PermissionExtended\\Models\\Role::class,\n\n    ],\n...\n```\n\n## Usage\nFor general usage of the package please look at [documentation of spatie/laravel-permission](https://github.com/spatie/laravel-permission/).\n\nIf you want to listen the events fired when a permission/role is assigned or revoked you can do that as follows.\n\n1) Create a Listener class:\n```php\n\nclass PermissionsEventSubscriber\n{\n    public function onPermissionAssigned(PermissionAssigned $event)\n    {\n        //$event-\u003epermission is a Collection of Permissions\n        //$event-\u003etarget is an Eloquent model \n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpadosoft%2Flaravel-permission-extended","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpadosoft%2Flaravel-permission-extended","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpadosoft%2Flaravel-permission-extended/lists"}