PHPackages                             aboleon/metaframework - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. aboleon/metaframework

ActiveLibrary[Framework](/categories/framework)

aboleon/metaframework
=====================

Meta Framework CMS

1.1.0(1mo ago)0499↓50%22proprietaryJavaScriptPHP ^8.3

Since Feb 28Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/aboleon/metaframework)[ Packagist](https://packagist.org/packages/aboleon/metaframework)[ RSS](/packages/aboleon-metaframework/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelogDependencies (16)Versions (381)Used By (2)

Meta Framework
==============

[](#meta-framework)

Utility Sub Framework pour Laravel :: This is a personnal project with frequent changes, prototype state; use with caution at your own risk

### Installation

[](#installation)

```
composer require aboleon/metaframework`

```

MetaFramework Installation Instructions
=======================================

[](#metaframework-installation-instructions)

This guide provides step-by-step instructions for installing and configuring the **MetaFramework** using the provided `Install.php` console command.

---

Prerequisites
-------------

[](#prerequisites)

Before proceeding, ensure that your environment meets the following requirements:

- PHP &gt;= 8.3
- Laravel - 11.x, 12.x
- Composer installed

---

Installation Steps
------------------

[](#installation-steps)

### 1. **Run the Install Command**

[](#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**

[](#2-provide-configuration-details)

During the installation, you will be prompted to provide the following details:

1. **App Name**:

    - Enter the name of your application.
    - Example: `My Awesome App`
2. **Default Language Locale**:

    - Enter the default language locale for your application (e.g., `en`, `fr`, `de`).
    - Default: `en`
3. **Back-Office Route Prefix**:

    - Enter the prefix for your back-office routes.
    - Example: `admin`

---

### 3. **Configuration Files**

[](#3-configuration-files)

The installer will perform the following actions:

1. **Update `app.php` Configuration**:

    - The `app.php` configuration file will be updated with the provided app name and default locale.
2. **Create `mfw.php` Configuration**:

    - A new configuration file (`mfw.php`) will be created in the `config` directory 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
        ];
        ```
3. **Update Routes**:

    - The dashboard route will be updated to use the provided back-office route prefix.

---

### 4. **Publish Configuration Files**

[](#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)**

[](#41-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
```

---

### 4.2 **Publish Auth Sub-Package (Optional)**

[](#42-publish-auth-sub-package-optional)

MetaFramework ships an auth scaffold as a publishable sub-package (`mfw-auth`).

Publish directly:

```
php artisan vendor:publish --provider="MetaFramework\ServiceProvider" --tag="mfw-auth"
```

Or use the helper command (publishes files with overwrite enabled and wires auth routes in `routes/web.php`):

```
php artisan mfw auth
```

Published auth files include:

- `app/Http/Controllers/Auth/*`
- `app/Http/Requests/Auth/LoginRequest.php`
- `app/View/Components/GuestLayout.php`
- `resources/views/auth/*`
- `routes/auth.php`
- `lang/en/mfw-auth.php` and `lang/fr/mfw-auth.php`
- `public/front/css/auth.css`

---

### 5. **Admin User &amp; Seeds**

[](#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**

[](#6-developmentmaintenance-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 &amp; Access Management
-----------------------------

[](#roles--access-management)

### 1) Enable role capabilities on your User model

[](#1-enable-role-capabilities-on-your-user-model)

```
use MetaFramework\Traits\Users;

class User extends Authenticatable
{
    use Users;
}
```

### 2) Data model

[](#2-data-model)

Role access is database-driven with:

- `role_groups` table (role group catalog)
- `roles` table (role catalog)
- `users_roles` table (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.php`
- `publishables/database/migrations/2022_05_15_214500_create_roles_table.php`
- `publishables/database/migrations/2022_05_15_214516_create_user_roles_table.php`

### 3) Usage in code and Blade

[](#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

[](#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`)
------------------------------------------------

[](#core-usertype-segregation-system--account)

MetaFramework supports separating auth domains on the same `users` table via a `type` discriminator.

When using `aboleon/metaframework-accounts`, the `config/mfw-user-types.php` file is now owned/published by the accounts package (not by `metaframework`). MetaFramework still provides the runtime helpers (`MetaFramework\Support\UserTypes`, `MetaFramework\Traits\TypedUser`) that consume this configuration.

### 1) Configure `config/mfw-user-types.php`

[](#1-configure-configmfw-user-typesphp)

```
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

[](#2-build-guard-aware-credentials)

```
use MetaFramework\Support\UserTypes;

$credentials = UserTypes::addToCredentials(
    $request->only('email', 'password'),
    guard: 'account'
);
```

### 3) Typed model variants

[](#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
------------------------

[](#administration-nav-links)

Typical administration submenu links:

```
{{ __('mfw-users.users.nav') }}
{{ __('mfw-users.role_groups.nav') }}
{{ __('mfw-users.roles.nav') }}
```

**Required for AJAX actions:** place this container in a convenient spot in your app layout so the nav actions can post to MFW Ajax:

```

```

---

ArtisanController UI Commands
-----------------------------

[](#artisancontroller-ui-commands)

The maintenance UI triggers `MetaFramework\Controllers\ArtisanController` to run a small set of safe commands:

- `optimize:clear`
- `migrate` (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
---------------

[](#troubleshooting)

- **File Permission Issues**: ensure `config/` and `database/` are writable.
- **Missing Methods**: confirm the package service provider is registered.
- **Invalid Input**: re-run the command and provide valid values.

---

Cyrillic Content Utilities
--------------------------

[](#cyrillic-content-utilities)

MetaFramework provides `MetaFramework\Polyglote\Traits\CyrillicContentTrait` for reusable Cyrillic checks.

- `hasCyrillic(string $value): bool` detects Cyrillic characters in a string.
- `isCyrillicLocale(?string $locale): bool` checks whether a locale uses Cyrillic script (supports region variants like `bg_BG`).

Example usage:

```
use MetaFramework\Polyglote\Traits\CyrillicContentTrait;

class Example
{
    use CyrillicContentTrait;
}
```

---

Uninstallation
--------------

[](#uninstallation)

Remove `config/mfw.php`, revert any changes to `config/app.php`, and delete published resources as needed.

---

### License

[](#license)

The Metaframework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance89

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 93.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

378

Last Release

53d ago

Major Versions

0.x-dev → 1.0.02026-02-27

PHP version history (3 changes)0.1.4PHP ^8.1

0.114.5PHP ^8.2

0.125.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/bd427eef37726c93700471f509dcb5bd190be25cfa3aa01e388e117d6a353b71?d=identicon)[aboleon](/maintainers/aboleon)

---

Top Contributors

[![aboleon](https://avatars.githubusercontent.com/u/86931678?v=4)](https://github.com/aboleon "aboleon (167 commits)")[![Richardwagaia](https://avatars.githubusercontent.com/u/81816677?v=4)](https://github.com/Richardwagaia "Richardwagaia (9 commits)")[![lingtalfi](https://avatars.githubusercontent.com/u/223667?v=4)](https://github.com/lingtalfi "lingtalfi (3 commits)")

---

Tags

meta framework

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/aboleon-metaframework/health.svg)

```
[![Health](https://phpackages.com/badges/aboleon-metaframework/health.svg)](https://phpackages.com/packages/aboleon-metaframework)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.7k509.9M17.0k](/packages/laravel-framework)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[laravel/lumen-framework

The Laravel Lumen Framework.

1.5k26.2M709](/packages/laravel-lumen-framework)[magento/community-edition

Magento 2 (Open Source)

12.1k52.1k10](/packages/magento-community-edition)[elgg/elgg

Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications.

1.7k15.7k5](/packages/elgg-elgg)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19562.3M1.3k](/packages/drupal-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
