定制 webrek/laravel-mongo-permission-filament 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

webrek/laravel-mongo-permission-filament

Composer 安装命令:

composer require webrek/laravel-mongo-permission-filament

包简介

Filament v3 panel resources for webrek/laravel-mongo-permission

README 文档

README

Filament v3 panel resources for webrek/laravel-mongo-permission.

Status

v1.0.0. The plugin ships working Role and Permission resources for a Filament panel. Forms support name, guard, team scope, attached permissions, and (for roles) parent-role inheritance. Tables surface row counts and badge wildcard permissions.

Not included yet:

  • A relation manager on the User resource (assign roles/permissions to a user from the user edit page).
  • A team-aware scope filter on the panel.
  • Bulk wildcard warnings on permission creation.

Contributions welcome — see "Roadmap" below.

Requirements

Dependency Version
PHP 8.2+
Laravel 12.x
Filament 3.x
webrek/laravel-mongo-permission ^1.5

Install

composer require webrek/laravel-mongo-permission-filament

Register the plugin on your Filament panel:

use Webrek\MongoPermissionFilament\MongoPermissionPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            MongoPermissionPlugin::make(),
        ]);
}

The plugin adds two resources under an "Access control" navigation group: Roles and Permissions.

What the resources do

Roles

  • Create / edit a role with name, guard, optional team_id.
  • Attach permissions via a multi-select pulling from the Mongo permissions collection.
  • Inheritance: pick parent roles via a multi-select; the underlying package walks the chain at lookup time.
  • List: searchable by name, sortable by guard. Permission and parent counts are shown inline.

Permissions

  • Create / edit with name, guard, optional team_id.
  • Names containing * are visually badged so operators notice wildcard creation.
  • List: searchable, sortable, filterable by guard.

Roadmap

The plugin is intentionally minimal. Future work:

  1. User relation manager — a relation manager you can plug into your own UserResource so admins can attach / detach roles and permissions on a user without leaving the user record. Will honor team context and surface expiry on each grant.
  2. Team filter — a panel-level filter that scopes all resource queries to the current team, integrating with the package's setPermissionsTeamId and team-context middleware.
  3. TTL grant UI — assign-until widget in the relation manager for expiring grants.
  4. Bulk-import — UI wrapper around permission:migrate-from-spatie.
  5. Fuller panel tests — table and edit-page render coverage (record creation and plugin registration are already tested).

Open an issue or PR with proposals.

License

MIT

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固