hex-digital / admin-module
Module for providing core admin functionality to our Laravel projects.
Requires
- php: ^8.2
- filament/filament: ^2.0
- illuminate/filesystem: ^10.0
- illuminate/support: ^10.0
- jeffgreco13/filament-breezy: ^1.5
- spatie/laravel-package-tools: ^1.15
- spatie/laravel-permission: ^5.10
Requires (Dev)
- hex-digital/config-pint: ^1.1
- laravel/pint: ^1.10
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.6
- pestphp/pest-plugin-arch: ^2.1
- phpstan/phpstan: ^1.10
- spatie/laravel-ray: ^1.32
- dev-main
- v0.2.0
- v0.1.0
- dev-dependabot/npm_and_yarn/axios-1.6.0
- dev-dependabot/composer/orchestra/testbench-8.14.1
- dev-dependabot/composer/pestphp/pest-2.24.2
- dev-dependabot/composer/phpstan/phpstan-1.10.41
- dev-dependabot/composer/spatie/laravel-permission-6.0.1
- dev-dependabot/composer/laravel/pint-1.13.5
- dev-dependabot/composer/filament/filament-2.17.55
- dev-dependabot/composer/pestphp/pest-plugin-arch-2.4.1
- dev-dependabot/github_actions/stefanzweifel/git-auto-commit-action-5
- dev-dependabot/npm_and_yarn/postcss-8.4.31
- dev-dependabot/composer/spatie/laravel-ray-1.33.0
- dev-dependabot/github_actions/actions/checkout-4
- dev-dependabot/composer/spatie/laravel-package-tools-1.16.1
- dev-dependabot/npm_and_yarn/vite-4.3.9
- dev-dependabot/composer/jeffgreco13/filament-breezy-1.5.9
This package is auto-updated.
Last update: 2024-12-11 16:19:47 UTC
README
This module provides the core admin functionality for our Laravel projects. This module automatically takes care of installing and configuring Filament, managing admins and managing admin roles and permissions.
Installation
To get started with the admin module, you can install the pacakge via composer:
composer require hex-digital/admin-module
Next, you'll need to publish the config file, migrations and assets for the module and module dependencies. To simplfy this, the module comes with an install command:
php artisan admin-module:install
Every time you upgrade the module or Filament, you need to run the admim:module
and filament:upgrade
commands. We
recommend adding this to your composer.json's post-update-cmd:
"post-update-cmd": [ // ... "@php artisan filament:upgrade", "@php artisan admin-module:publish", ],
You should now run your migrations and sync the permissions:
php artisan migrate php artisan permission:sync
Lastly, you can create a new admin account using:
php artisan make:filament-user
Visit your admin panel at /admin
to sign in, and you're ready to start building.
Usage
Models & Resources
The admin module ships with an Admin
which is used for authentication. You can override this model by setting the
admin-module.admins.model
config.
Under the hood, we use the Spatie Roles and Permissions package for authorization of admins. The admin module exposes a resource for managing both admins and roles.
You can customise these models / resources by editing the config.
Permissions
The admin module exposes a permission:sync
commandwhich allows you to sync permissions which can then be assigned to
roles. By default, the module provides permissions for managing admins and roles. However, you can add your own
permissions to the admin-module.permissions
config.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
If you discover a security vulnerability, please send an e-mail to dev@hexdigital.com. All security vulnerabilities will be promptly addressed.
Credits
License
The MIT License (MIT). Please see License File for more information.