aboleon / metaframework
Meta Framework CMS
Installs: 459
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 2
Open Issues: 0
Language:JavaScript
pkg:composer/aboleon/metaframework
Requires
- php: ^8.3
- aboleon/metaframework-inputable: ^1.0
- aboleon/metaframework-support: ^1.0
- css-crush/css-crush: ^v5.0.0
- spatie/laravel-translatable: ^6.12
- symfony/mime: ^7.2
Requires (Dev)
- orchestra/testbench: ^10.6
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.0.1
- dev-mfw-2026
- 0.157.3
- 0.157.2
- 0.157.1
- 0.157.0
- 0.156.2
- 0.156.1
- 0.156.0
- 0.155.0
- 0.154.2
- 0.154.1
- 0.154.0
- 0.153.1
- 0.153.0
- 0.152.0
- 0.151.0
- 0.150.4
- 0.150.3
- 0.150.2
- 0.150.1
- 0.150.0
- 0.149.2
- 0.149.1
- 0.149.0
- 0.148.2
- 0.148.1
- 0.148.0
- 0.147.0
- 0.146.0
- 0.145.0
- 0.144.2
- 0.144.1
- 0.144.0
- 0.143.0
- 0.142.0
- 0.141.0
- 0.140.2
- 0.140.1
- 0.140.0
- 0.139.1
- 0.139.0
- 0.138.1
- 0.138.0
- 0.137.2
- 0.137.1
- 0.137.0
- 0.136.6
- 0.136.5
- 0.136.4
- 0.136.3
- 0.136.2
- 0.136.1
- 0.136.0
- 0.135.0
- 0.134.0
- 0.133.0
- 0.132.3
- 0.132.2
- 0.132.1
- 0.132.0
- 0.131.0
- 0.130.1
- 0.130.0
- 0.129.0
- 0.128.0
- 0.127.2
- 0.127.1
- 0.127.0
- 0.126.1
- 0.126.0
- 0.125.1
- 0.125.0
- 0.124.0
- 0.123.1
- 0.123.0
- 0.122.0
- 0.121.0
- 0.120.0
- 0.119.4
- 0.119.3
- 0.119.2
- 0.119.1
- 0.119.0
- 0.118.0
- 0.117.2
- 0.117.1
- 0.117.0
- 0.116.2
- 0.116.1
- 0.116.0
- 0.115.3
- 0.115.2
- 0.115.1
- 0.115.0
- 0.114.7
- 0.114.6
- 0.114.5
- 0.114.4
- 0.114.3
- 0.114.2
- 0.114.1
- 0.114.0
- 0.113.2
- 0.113.1
- 0.113.0
- 0.112.0
- 0.111.4
- 0.111.3
- 0.111.2
- 0.111.1
- 0.111.0
- 0.110.0
- 0.109.1
- 0.109.0
- 0.108.0
- 0.107.1
- 0.107.0
- 0.106.0
- 0.105.0
- 0.104.2
- 0.104.1
- 0.104.0
- 0.103.1
- 0.103.0
- 0.102.2
- 0.102.1
- 0.102.0
- 0.101.2
- 0.101.1
- 0.101.0
- 0.100.2
- 0.100.1
- 0.100.0
- 0.99.1
- 0.99.0
- 0.98.6
- 0.98.5
- 0.98.4
- 0.98.3.1
- 0.98.3
- 0.98.2
- 0.98.1
- 0.98.0
- 0.97.3
- 0.97.2
- 0.97.1
- 0.97.0
- 0.96.1
- 0.96.0
- 0.95.0
- 0.94.2
- 0.94.1
- 0.94.0
- 0.93.0
- 0.92.0
- 0.91.0
- 0.90.0
- 0.89.4
- 0.89.3
- 0.89.2
- 0.89.1
- 0.89.0
- 0.88.9
- 0.88.8
- 0.88.7
- 0.88.6
- 0.88.5
- 0.88.4
- 0.88.3
- 0.88.2
- 0.88.1
- 0.88.0
- 0.87.0
- 0.86.0
- 0.85.1
- 0.85.0
- 0.84.2
- 0.84.1
- 0.84.0
- 0.83.0
- 0.82.1
- 0.82.0
- 0.81.1
- 0.81.0
- 0.80.0
- 0.79.1
- 0.79.0
- 0.78.9
- 0.78.8
- 0.78.7
- 0.78.6
- 0.78.5
- 0.78.4
- 0.78.3
- 0.78.2
- 0.78.1
- 0.78.0
- 0.77.0
- 0.76.0
- 0.75.5
- 0.75.4
- 0.75.3
- 0.75.2
- 0.75.1
- 0.75.0
- 0.74.0
- 0.73.0
- 0.71.0
- 0.70.5
- 0.70.4
- 0.70.3
- 0.70.2
- 0.70.1
- 0.70.0
- 0.69.1
- 0.69.0
- 0.68.1
- 0.68.0
- 0.67.3
- 0.67.2
- 0.67.1
- 0.67.0
- 0.66.2
- 0.66.1
- 0.66.0
- 0.65.0
- 0.64.0
- 0.63.1
- 0.63.0
- 0.62.0
- 0.61.0
- 0.60.0
- 0.59.0
- 0.58.0
- 0.57.2
- 0.57.1
- 0.57.0
- 0.56.0
- 0.55.0
- 0.54.6
- 0.54.5
- 0.54.4
- 0.54.3
- 0.54.2
- 0.54.1
- 0.54.0
- 0.53.0
- 0.52.0
- 0.51.0
- 0.50.3
- 0.50.2
- 0.50.1
- 0.50.0
- 0.49.0
- 0.48.10
- 0.48.9
- 0.48.8
- 0.48.7
- 0.48.6
- 0.48.5
- 0.48.4
- 0.48.3
- 0.48.2
- 0.48.1
- 0.48.0
- 0.47.1
- 0.47.0
- 0.46.2
- 0.46.1
- 0.46
- 0.45.2
- 0.45.1
- 0.45.0
- 0.44.4
- 0.44.3
- 0.44.2
- 0.44.1
- 0.44.0
- 0.43.0
- 0.42
- 0.41
- 0.40.2
- 0.40.1
- 0.40.0
- 0.39.0
- 0.38.0
- 0.37.0
- 0.36.1
- 0.36.0
- 0.35.0
- 0.34.0
- 0.33.0
- 0.32.0
- 0.31.0
- 0.30.0
- 0.29.0
- 0.28.1
- 0.28.0
- 0.27.0
- 0.26.1
- 0.26.0
- 0.25.0
- 0.24.2
- 0.24.1
- 0.24.0
- 0.23.1
- 0.23.0
- 0.22.1
- 0.22.0
- 0.21.0
- 0.20.0
- 0.19.1
- 0.19.0
- 0.18.0
- 0.17.0
- 0.16.1
- 0.16.0
- 0.15.2
- 0.15.1
- 0.15.0
- 0.14.1
- 0.14.0
- 0.13.0
- 0.12.0
- 0.11.1
- 0.11.0
- 0.10.2
- 0.10.1
- 0.10.0
- 0.9.0
- 0.8.0
- 0.7.1
- 0.7.0
- 0.6.0
- 0.5.1
- 0.5.0
- 0.4.4
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.1
- 0.3.0
- 0.2.0
- 0.1.x-dev
- 0.1.7
- 0.1.6.1
- 0.1.6
- 0.1.5
- 0.1.4
- dev-mfw-2025-2
- dev-mfw-2025
This package is auto-updated.
Last update: 2026-02-16 09:41:01 UTC
README
Utility Sub Framework pour Laravel :: This is a personnal project with frequent changes, prototype state; use with caution at your own risk
Installation
composer require aboleon/metaframework`
MetaFramework Installation Instructions
This guide provides step-by-step instructions for installing and configuring the MetaFramework using the provided Install.php console command.
Prerequisites
Before proceeding, ensure that your environment meets the following requirements:
- PHP >= 8.3
- Laravel - 11.x, 12.x
- Composer installed
Installation Steps
1. Run the Install Command
To begin the installation, run the following Artisan command:
php artisan mfw config
This command will guide you through the configuration process.
2. Provide Configuration Details
During the installation, you will be prompted to provide the following details:
-
App Name:
- Enter the name of your application.
- Example:
My Awesome App
-
Default Language Locale:
- Enter the default language locale for your application (e.g.,
en,fr,de). - Default:
en
- Enter the default language locale for your application (e.g.,
-
Back-Office Route Prefix:
- Enter the prefix for your back-office routes.
- Example:
admin
3. Configuration Files
The installer will perform the following actions:
-
Update
app.phpConfiguration:- The
app.phpconfiguration file will be updated with the provided app name and default locale.
- The
-
Create
mfw.phpConfiguration:- A new configuration file (
mfw.php) will be created in theconfigdirectory with the following structure:return [ 'route' => 'admin', // Your provided back-office route prefix 'locales' => ['en'], // Your provided default locale 'active_locales' => ['en'] // Your provided default locale ];
- A new configuration file (
-
Update Routes:
- The dashboard route will be updated to use the provided back-office route prefix.
4. Publish Configuration Files
The installer will automatically publish the necessary configuration files using:
php artisan vendor:publish --provider="MetaFramework\ServiceProvider" --tag="mfw-install"
4.1 Publish Language Files (Force Overwrite)
To (re)publish MetaFramework language files and overwrite existing files in your app:
php artisan vendor:publish --tag="mfw-lang" --force
5. Admin User & Seeds
The installer can also generate an admin user seeder and enhanced user factory. When prompted, provide the admin’s first name, last name, email, and password (leave blank to auto-generate). You can choose which role should be assigned to that admin.
The generated seeder writes the selected role into users_roles for the created admin account.
After the wizard completes, run:
php artisan migrate --seed
to set up the database and seed the admin user.
6. Development/Maintenance Nav View
MetaFramework includes a maintenance navigation view (dev.blade.php) for common development operations:
- Database migrations / rollback
- Application cache reset
Publish for customization:
php artisan mfw views
Or:
php artisan vendor:publish --provider="MetaFramework\ServiceProvider" --tag="mfw-views"
Published to: resources/views/vendor/mfw/nav/dev.blade.php
Include in layout:
@include('vendor.mfw.nav.dev') {{-- published version --}} @include('mfw::nav.dev') {{-- package version --}}
Note: Uses @role('dev|super-admin') directive for role-based visibility.
Roles & Access Management
1) Enable role capabilities on your User model
use MetaFramework\Traits\Users; class User extends Authenticatable { use Users; }
2) Data model
Role access is database-driven with:
role_groupstable (role group catalog)rolestable (role catalog)users_rolestable (user/role assignments)
Only dev and super-admin are core access roles. Role groups are optional and serve as app-level classification/refinement.
Core system roles are reserved and always available:
dev(id: 1)super-admin(id: 2)
Roles can be managed in the back-office at:
route('mfw.role-groups.index')route('mfw.roles.index')- System users listing:
route('mfw.users.index', 'super-admin')
Published role migration stubs (install baseline):
publishables/database/migrations/2022_05_15_214450_create_role_groups_table.phppublishables/database/migrations/2022_05_15_214500_create_roles_table.phppublishables/database/migrations/2022_05_15_214516_create_user_roles_table.php
3) Usage in code and Blade
Model checks:
$user->hasRole('dev'); $user->hasRole('dev|super-admin'); $user->hasRole(['dev', 'super-admin']); $user->hasRole('2'); // by role id
Blade checks:
@role('dev|super-admin') ... @endrole
4) Fresh install fallback behavior
If users_roles has no assignment at all (fresh installation), hasRole() falls back to authenticated access for protected checks.
As soon as at least one role assignment exists in database, strict role checks are applied.
Core UserType Segregation (system / account)
MetaFramework supports separating auth domains on the same users table via a type discriminator.
1) Configure config/mfw-user-types.php
return [ 'enabled' => true, // core behavior (can still be disabled explicitly) 'column' => 'type', 'values' => ['system', 'account'], 'default' => 'system', 'guards' => [ 'web' => 'system', 'account' => 'account', ], ];
2) Build guard-aware credentials
use MetaFramework\Support\UserTypes; $credentials = UserTypes::addToCredentials( $request->only('email', 'password'), guard: 'account' );
3) Typed model variants
use MetaFramework\Traits\TypedUser; class SystemUser extends User { use TypedUser; protected static function typedUserScopeType(): ?string { return 'system'; } } class AccountUser extends User { use TypedUser; protected static function typedUserScopeType(): ?string { return 'account'; } }
When enabled=false, credentials are not altered and typed scopes are skipped.
Administration Nav Links
Typical administration submenu links:
<a href="{{ route('mfw.users.index', 'super-admin') }}">{{ __('mfw-users.users.nav') }}</a> <a href="{{ route('mfw.role-groups.index') }}">{{ __('mfw-users.role_groups.nav') }}</a> <a href="{{ route('mfw.roles.index') }}">{{ __('mfw-users.roles.nav') }}</a>
Required for AJAX actions: place this container in a convenient spot in your app layout so the nav actions can post to MFW Ajax:
<div id="mfw-messages" data-ajax="{{route('mfw-ajax') }}"></div>
ArtisanController UI Commands
The maintenance UI triggers MetaFramework\Controllers\ArtisanController to run a small set of safe commands:
optimize:clearmigrate(forced, non-interactive)migrate:rollback(forced, non-interactive)composer update(production or dev flags depending on the action)
PHP path override for Composer: if the server PHP binary is not in PATH (example error: /usr/bin/env: 'php': No such file or directory), set MF_SHELL_PATH_PREFIX to a PHP bin path to prepend before running Composer. Example: MF_SHELL_PATH_PREFIX=/opt/plesk/php/8.5/bin.
Troubleshooting
- File Permission Issues: ensure
config/anddatabase/are writable. - Missing Methods: confirm the package service provider is registered.
- Invalid Input: re-run the command and provide valid values.
Cyrillic Content Utilities
MetaFramework provides MetaFramework\Polyglote\Traits\CyrillicContentTrait for reusable Cyrillic checks.
hasCyrillic(string $value): booldetects Cyrillic characters in a string.isCyrillicLocale(?string $locale): boolchecks whether a locale uses Cyrillic script (supports region variants likebg_BG).
Example usage:
use MetaFramework\Polyglote\Traits\CyrillicContentTrait; class Example { use CyrillicContentTrait; }
Uninstallation
Remove config/mfw.php, revert any changes to config/app.php, and delete published resources as needed.
License
The Metaframework is open-sourced software licensed under the MIT license.