vormiaphp / vormia
A comprehensive Laravel package for user management, roles, permissions, and utilities
Requires
- php: ^8.2
- intervention/image: ^3.11
- laravel/framework: ^12.0
Requires (Dev)
- phpunit/phpunit: ^10.0
README
Introduction
A comprehensive Laravel development package that streamlines media handling, notifications, and role management with a modular, maintainable approach.
VormiaPHP offers robust tools for handling media, managing notifications, and implementing essential features like user roles and permissions. The package is designed with a modular structure, separating concerns through dedicated namespaces for models, services, middleware, and traits.
Features
- File & Image Processing
- Notification System
- Role-Based Access Control
- Modular Architecture
- Livewire Integration
- Database Organization
Installation
Before installing Vormia, ensure you have Laravel installed. Note: Inertia is not yet supported.
Step 1: Install Laravel
composer create-project laravel/laravel myproject
cd myproject
OR Using Laravel Installer
laravel new myproject
cd myproject
Step 2: Install Vormia
composer require vormiaphp/vormia
Step 3: Run Vormia Installation
php artisan vormia:install
- All notification stubs will be copied to
app/Notifications
. - All jobs in
stubs/jobs/Vrm
will be copied toapp/Jobs/Vrm
.
If you want API support, run:
php artisan vormia:install --api
- All notification stubs will be copied to
app/Notifications
. - All jobs in
stubs/jobs/Vrm
will be copied toapp/Jobs/Vrm
. - All jobs in
stubs/jobs/V1
will be copied toapp/Jobs/V1
. - All API controllers in
stubs/controllers/Api
will be copied toapp/Http/Controllers/Api
. - The API routes file in
stubs/routes/api.php
will be copied toroutes/api.php
(you may be prompted to overwrite). - The Postman collection in
stubs/public/Vormia.postman_collection.json
will be copied topublic/Vormia.postman_collection.json
. - You must add the
HasApiTokens
trait to yourUser
model (app/Models/User.php
) for API authentication.
Then, you must install Sanctum yourself:
php artisan install:api
This will install Laravel Sanctum and set up API authentication.
- If you see a message like:
Some middleware aliases or providers could not be added automatically. Please add them manually to bootstrap/app.php:
Add these to your middleware aliases array:
->withMiddleware(function (Middleware $middleware): void {
//
$middleware->alias([
'role' => \App\Http\Middleware\Vrm\CheckRole::class,
'module' => \App\Http\Middleware\Vrm\CheckModule::class,
'permission' => \App\Http\Middleware\Vrm\CheckPermission::class,
]);
})
then open bootstrap/app.php
and add the above lines to the appropriate arrays.
Add these to your providers array bootstrap/providers.php:
App\Providers\Vrm\NotificationServiceProvider::class,
App\Providers\Vrm\TokenServiceProvider::class,
App\Providers\Vrm\MediaForgeServiceProvider::class,
App\Providers\Vrm\UtilitiesServiceProvider::class,
App\Providers\Vrm\GlobalDataServiceProvider::class,
open bootstrap/providers.php
and add the above lines to the appropriate arrays.
-
Configure your
.env
file as needed. -
Run migrations:
php artisan migrate
🟢 API-first Vormia version If you want to bootstrap your project with API support, use:
php artisan vormia:install --api
Then, install Sanctum manually:
php artisan install:api
Uninstallation
- Run the uninstall command:
php artisan vormia:uninstall