Download the PHP package abdulrahim/filament-modular-permissions without Composer

On this page you can find all versions of the php package abdulrahim/filament-modular-permissions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package filament-modular-permissions

Filament Modular Permissions

Latest Version on Packagist Total Downloads License

A professional Laravel package for modular roles and permissions in Filament v5. Supporting multi-panel, auto-syncing, and Global Zero-Config Protection.

Latest Stable Version: v1.5.5 Requirements: PHP 8.2+, Laravel 11+, Filament 5.x, spatie/laravel-permission ^6|^7


التوثيق العربي


English Documentation

Table of Contents


Features

Installation

Step 1 — Install via Composer:

Step 2 — Register the plugin in your Panel Provider:

Step 3 — Run the installer:

This command does three things automatically:

  1. Publishes the Role Management Resource
  2. Publishes the Panel User Management Resource
  3. Syncs all permissions from your Filament panels to the database

Then register both published resources in your Filament panel.

Or run each step individually if you need more control:

[!IMPORTANT] Re-run php artisan permissions:sync every time you add a new Resource or Widget to register its permissions in the database.

[!TIP] To publish to a specific panel, or to re-publish and overwrite existing files:

Initial User (Seeding)

To create your first Super Admin user, add this to your DatabaseSeeder.php:

Configuration

Custom Permissions

To add standalone permissions not tied to any resource, define them in your config:

Then run php artisan permissions:sync to register them.

Excluding Panels from Sync

Exclude specific panels from automatic syncing — useful for API panels, customer portals, or any panel that manages its own permissions separately:

Excluded panels are skipped by default; use --panel to bypass the exclusion explicitly:

Advanced Features

Widget Auto-Protection

Widgets are automatically hidden from users who don't have the required permission — no trait needed on any widget class.

The package uses a Filament::serving() hook to filter the widget list per-panel before rendering. The permission name follows the pattern view_{snake_widget_name}.

Run php artisan permissions:sync to register widget permissions, then assign them to roles via the Role form.

In the Role form, widget permissions are displayed in a dedicated section below the resource sections, with a wider horizontal layout (4 columns) for easy scanning.

[!NOTE] If you set auto_hide_resources => false in config, widget auto-protection is also disabled. You can then use the HandlesWidgetPermissions trait manually on each widget.

Diagnostics

Inspect a user's roles and effective permissions:

Advanced Concepts

1. Multi-Guard Architecture

The package handles multi-panel environments where each panel uses a different Auth Guard. Permissions are always isolated per guard.

2. Intelligent Super Admin

The super_admin role is granted full access via a global Gate::before check. This hook returns null (not false) when denying, so your own Policies always remain active.

3. Policy Compatibility

The Gate::before hook only intercepts known Filament abilities (viewAny, view, create, update, delete, etc.) on Eloquent models. All other policy checks are unaffected.

4. Model Instance Support

The gate check handles both class strings (used by viewAny/create) and model instances (used by update/delete/restore), ensuring all permission types are enforced correctly across all actions.

Manual Control

Disable the global shield in config/filament-modular-permissions.php:

Then use the traits manually in each Resource or Widget:

Available Commands

Command Description
permissions:install [--panel=] [--force] [--skip-user] All-in-one installer (publish + sync)
permissions:sync [--panel=] Sync permissions (skips excluded panels unless --panel is set)
permissions:publish-role-resource [--panel=] [--force] Publish Role Resource files
permissions:publish-user-resource [--panel=] [--force] Publish User Resource files
permissions:publish-config [--force] Publish the package config file
permissions:publish-lang [--force] [--lang=] Publish translation files (optionally one language only)
permissions:check [--user=] [--guard=] Diagnose user roles and permissions

Contact

Email: [email protected]
Website: abaad.dev


التوثيق العربي

آخر إصدار مستقر: v1.5.5 المتطلبات: PHP 8.2+، Laravel 11+، Filament 5.x، spatie/laravel-permission ^6|^7

فهرس المحتويات


المميزات الرئيسية

التثبيت

الخطوة الأولى — تحميل المكتبة عبر Composer:

الخطوة الثانية — تسجيل الإضافة في مسببات اللوحة (Panel Provider):

الخطوة الثالثة — تشغيل المثبت:

يقوم هذا الأمر بثلاثة أشياء تلقائياً:

  1. نشر واجهة إدارة الأدوار
  2. نشر واجهة إدارة مستخدمي اللوحة
  3. مزامنة جميع الصلاحيات من لوحات Filament إلى قاعدة البيانات

بعد ذلك، سجّل الـ Resources المنشورة في لوحة Filament الخاصة بك.

أو نفّذ كل خطوة بشكل منفرد:

[!IMPORTANT] أعد تشغيل php artisan permissions:sync في كل مرة تضيف فيها مورداً (Resource) أو ويدجت (Widget) جديداً.

[!TIP] للنشر على لوحة محددة أو لإعادة النشر فوق الملفات الموجودة:

إنشاء المستخدم الأول

لإنشاء مستخدم "سوبر أدمن" أول، أضف الكود التالي لملف DatabaseSeeder.php:

الإعدادات

الصلاحيات المخصصة

لإضافة صلاحيات مستقلة غير مرتبطة بمورد معين، قم بتعريفها في ملف الإعدادات:

ثم شغّل: php artisan permissions:sync

استثناء اللوحات

مفيد للوحات API أو البوابات الخارجية التي تدير صلاحياتها بشكل مستقل:

المميزات المتقدمة

الحماية التلقائية للويدجت

يتم إخفاء الويدجت تلقائياً عن المستخدمين غير المصرح لهم — بدون أي Trait على الويدجت. تعمل الحماية عبر Filament::serving() الذي يفلتر قائمة الويدجت لكل لوحة قبل العرض.

اسم الصلاحية: view_{اسم_الويدجت_بـ_snake_case} — شغّل permissions:sync لتسجيلها.

في نموذج الأدوار، تظهر صلاحيات الويدجت في قسم منفصل أسفل صلاحيات الأقسام بتخطيط أفقي (4 أعمدة).

تشخيص الأذونات

لفحص أدوار وصلاحيات مستخدم معين:

التحكم اليدوي

إذا أردت تعطيل الحماية التلقائية واستخدام الـ Traits يدوياً:

الأوامر المتاحة

الأمر الوصف
permissions:install [--panel=] [--force] [--skip-user] المثبت الموحد (نشر + مزامنة)
permissions:sync [--panel=] مزامنة الصلاحيات (يتخطى المستثناة ما لم يُحدد --panel)
permissions:publish-role-resource [--panel=] [--force] نشر ملفات إدارة الأدوار
permissions:publish-user-resource [--panel=] [--force] نشر ملفات إدارة المستخدمين
permissions:publish-config [--force] نشر ملف الإعدادات (config)
permissions:publish-lang [--force] [--lang=] نشر ملفات الترجمة (اختياريًا لغة محددة فقط)
permissions:check [--user=] [--guard=] تشخيص أدوار وصلاحيات مستخدم

التواصل

البريد الإلكتروني: [email protected]
الموقع الإلكتروني: abaad.dev

License

MIT License.


All versions of filament-modular-permissions with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
filament/filament Version ^5.0
spatie/laravel-permission Version ^6.0|^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package abdulrahim/filament-modular-permissions contains the following files

Loading the files please wait ...