{"id":21499845,"url":"https://github.com/hexters/hexa-lite","last_synced_at":"2025-04-04T23:06:58.610Z","repository":{"id":246742884,"uuid":"822405381","full_name":"hexters/hexa-lite","owner":"hexters","description":"Effortless role and permission management plugin for Filament","archived":false,"fork":false,"pushed_at":"2024-11-19T23:25:30.000Z","size":39,"stargazers_count":80,"open_issues_count":3,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T22:11:42.167Z","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/hexters.png","metadata":{"files":{"readme":"README.md","changelog":null,"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},"funding":{"github":"hexters","ko_fi":"hexters","patreon":"hexters"}},"created_at":"2024-07-01T05:10:00.000Z","updated_at":"2025-03-11T05:59:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"c4261ea4-0464-4b25-9e6a-a84d9544835b","html_url":"https://github.com/hexters/hexa-lite","commit_stats":null,"previous_names":["hexters/hexa-lite"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexters%2Fhexa-lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexters%2Fhexa-lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexters%2Fhexa-lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexters%2Fhexa-lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hexters","download_url":"https://codeload.github.com/hexters/hexa-lite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247261600,"owners_count":20910108,"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-11-23T17:18:38.553Z","updated_at":"2025-04-04T23:06:58.586Z","avatar_url":"https://github.com/hexters.png","language":"PHP","funding_links":["https://github.com/sponsors/hexters","https://ko-fi.com/hexters","https://patreon.com/hexters"],"categories":[],"sub_categories":[],"readme":"# Filament Hexa Lite\n\n[![Latest Stable Version](https://poser.pugx.org/hexters/hexa-lite/v/stable)](https://packagist.org/packages/hexters/hexa-lite)\n[![Total Downloads](https://poser.pugx.org/hexters/hexa-lite/downloads)](https://packagist.org/packages/hexters/hexa-lite)\n[![License](https://poser.pugx.org/hexters/hexa-lite/license)](https://packagist.org/packages/hexters/hexa-lite)\n\n\nFilament Hexa Lite is an effortless role \u0026 permission plugin for Filament, inspired by the concept of [hexters/ladmin](https://github.com/hexters/ladmin). This concept facilitates managing each role and permission inline with code and provides an easy-to-understand interface.\n\nThis plugin is intended only for Administrators, as it has a separate admin table from the user table provided by Laravel. Additionally, this plugin will replace the `auth.php` configuration file.\n\n![](https://github.com/hexters/assets/blob/main/hexa/v1/edit.png?raw=true)\n\n## About Filament\n\n[FilamentPHP](https://filamentphp.com/) is a lightweight and flexible PHP framework designed for building web applications. It aims to simplify application development by providing a clear structure and high modularity. The framework emphasizes speed, efficiency, and comes with many built-in features that facilitate effective web application development.\n\n## Installation\n\n\u003e **Note** \u003cbr\u003e\nYou need to install the filament package first. You can refer to the official site at [FilamentPHP](https://filamentphp.com)\n\nYou can install it by running the command below:\n\n```bash\ncomposer require hexters/hexa-lite\n```\n\nThen, proceed with the installation of the hexa plugin:\n```bash\nphp artisan hexa:install\n```\n\nInstall database migrations:\n```bash\nphp artisan migrate\n```\n\nCreate a superadmin account for admin login:\n```bash\nphp artisan hexa:account --create\n```\n\n## Plugin Setup\n\nAdd the Filament `HexaLite` plugin to the created panel. If you haven't created one yet, see how to do it here [Creating a new panel](https://filamentphp.com/docs/3.x/panels/configuration#creating-a-new-panel).\n\n```php\nuse Filament\\Panel;\nuse Hexters\\HexaLite\\HexaLite;\n \npublic function panel(Panel $panel): Panel\n{\n    return $panel\n        -\u003eplugins([\n            HexaLite::make(),\n        ]);\n}\n```\n\n## Declaring Access Permissions\n\n### Resource \u0026 Page\n\nTo declare access permissions for Resources and Pages, for Clusters you need to upgrade to the [hexters/hexa](https://github.com/hexters/hexa-docs) package.\n\n```php\nuse Hexters\\HexaLite\\Traits\\HexAccess;\n\n. . .\n\nuse HexAccess;\n\nprotected static ?string $permissionId = 'access.user';\n\nprotected static ?string $descriptionPermission = 'Admin can manage User accounts';\n\n/**\n * Additional permission (optional)\n * You can add it or not depending on the needs of your application.\n */\nprotected static ?array $subPermissions = [\n    'access.user.create' =\u003e 'Can Create',\n    'access.user.edit' =\u003e 'Can Edit',\n    'access.user.delete' =\u003e 'Can Delete',\n];\n\npublic static function canAccess(): bool\n{\n    return hexa()-\u003ecan(static::$permissionId);\n}\n\n. . .\n```\n\n### Actions, etc.\n\nYou can use the `visible()` method on several `Class Components`. For example, let's try it on a button.\n\n```php\nTables\\Actions\\EditAction::make()\n    -\u003evisible(hexa()-\u003ecan('access.user.edit')),\n```\n\nFor giving access to classes extended to `Filament\\Resources\\Pages\\EditRecord`, `Filament\\Resources\\Pages\\CreateRecord`, `Filament\\Resources\\Pages\\ListRecords`, `Filament\\Resources\\Pages\\ViewRecords`, you can use:\n```php\n/**\n * @param  array\u003cstring, mixed\u003e  $parameters\n */\npublic static function canAccess(array $parameters = []): bool\n{\n    return hexa()-\u003ecan('access.user.edit');\n}\n```\n\n## Checking Access Permissions\n\nAccess can be granted to Resources, Pages, Widgets, Button Actions, etc. The access can be given as shown below.\n\nUsing the hexa utility function:\n```php\nhexa()-\u003ecan('hexa.admin')\n```\n\nUsing Laravel's auth can function:\n```php\nauth()-\u003euser()?-\u003ecan('hexa.admin')\n```\n\nUsing Laravel's Gate class:\n```php\nuse Illuminate\\Support\\Facades\\Gate;\n\n. . .\n\nGate::allows('hexa.admin')\n```\n\nIn a blade template, you can use it as shown below.\n\n```html\n\u003cdiv\u003e\n    @can('hexa.admin')\n        // Content here ...\n    @endcan\n\u003c/div\u003e\n```\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/hexters/hexa-lite/blob/main/LICENSE.md) file for details.\n\n## Issue\n\nIf you encounter any issues with this plugin, you can submit them to the repository:\n[Filament Hexa Lite Issue](https://github.com/hexters/hexa-lite/issues)\n\nThank you for using this plugin. We hope it speeds up your process in creating powerful applications.\n\nHappy Coding 🧑‍💻 🧑‍💻 🧑‍💻\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexters%2Fhexa-lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhexters%2Fhexa-lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexters%2Fhexa-lite/lists"}