PHPackages                             rynbd/lyrapanel - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. rynbd/lyrapanel

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

rynbd/lyrapanel
===============

A powerful admin &amp; user dashboard with RBAC and dynamic CRUD for Laravel 12

v1.0.1(2mo ago)02MITBladePHP ^8.2

Since Mar 8Pushed 2mo agoCompare

[ Source](https://github.com/WPCodeLab/lyra-panel)[ Packagist](https://packagist.org/packages/rynbd/lyrapanel)[ RSS](/packages/rynbd-lyrapanel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

LyraPanel
=========

[](#lyrapanel)

A comprehensive, production-ready Laravel 12 admin panel package with RBAC, dynamic CRUD, user management, audit trails, and more.

Features
--------

[](#features)

- **Role-Based Access Control (RBAC)** — Roles and fine-grained privileges with middleware
- **User Management** — Full CRUD, suspension, impersonation, role assignment
- **Dynamic Resource CRUD** — Register any Eloquent model for automatic CRUD via `HasDynamicCrud` trait
- **Admin &amp; User Dashboards** — Separate dashboards with stats and quick actions
- **Audit Trail** — Comprehensive logging of all admin actions with old/new value diff
- **User Impersonation** — Login as any user with one click (admin-only)
- **Invitation System** — Invite users via email with role pre-assignment
- **Settings Management** — UI-based configuration for branding, features, and themes
- **Admin Bar** — Global notice bar for system-wide announcements
- **Dark/Light Theme** — Toggle between themes with `localStorage` persistence, shadcn/ui-inspired CSS variables
- **Artisan Install Command** — Interactive installer for quick setup

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 12.x
- Laravel Sanctum 4.x (included)

Installation
------------

[](#installation)

### 1. Require the package

[](#1-require-the-package)

```
composer require rynbd/lyrapanel
```

### 2. Run the install command

[](#2-run-the-install-command)

```
php artisan lyra:install
```

This interactive command will:

- Publish configuration and migration files
- Run migrations to create required tables
- Add required traits to your `User` model
- Seed default roles and privileges
- Create an admin user

### Manual Installation

[](#manual-installation)

If you prefer manual setup:

```
# Publish config
php artisan vendor:publish --tag=lyrapanel-config

# Publish migrations
php artisan vendor:publish --tag=lyrapanel-migrations

# Run migrations
php artisan migrate
```

Then add the following traits to your `User` model:

```
use Rynbd\LyraPanel\Traits\HasRoles;
use Rynbd\LyraPanel\Traits\HasPrivileges;
use Rynbd\LyraPanel\Traits\HasSuspension;

class User extends Authenticatable
{
    use HasRoles, HasPrivileges, HasSuspension;
}
```

Configuration
-------------

[](#configuration)

Publish and edit the config file at `config/lyrapanel.php`:

```
return [
    'routes' => [
        'prefix' => 'panel',           // URL prefix
        'middleware' => ['web', 'auth'], // Applied middleware
        'admin_middleware' => ['role:admin'], // Admin-only middleware
    ],
    'pagination' => ['per_page' => 15],
    'audit' => ['enabled' => true],
    'impersonation' => ['enabled' => true],
    'invitations' => ['enabled' => true],
    'branding' => [
        'name' => 'LyraPanel',
        'logo' => null,
    ],
    // ...more options
];
```

Usage
-----

[](#usage)

### Roles &amp; Privileges

[](#roles--privileges)

```
// Assign roles
$user->assignRole('admin');
$user->assignRole('editor');

// Check roles
$user->hasRole('admin');         // true
$user->hasAnyRole(['admin', 'editor']); // true

// Check privileges (through roles)
$user->hasPrivilege('users.create');
$user->can('posts.edit');        // alias for hasPrivilege
```

### Middleware

[](#middleware)

```
// In routes
Route::middleware('role:admin')->group(function () {
    // Admin-only routes
});

Route::middleware('privilege:posts.create')->group(function () {
    // Routes requiring specific privilege
});

Route::middleware('not-suspended')->group(function () {
    // Block suspended users
});
```

### Dynamic CRUD Resources

[](#dynamic-crud-resources)

Add the `HasDynamicCrud` trait to any model:

```
use Rynbd\LyraPanel\Traits\HasDynamicCrud;

class Post extends Model
{
    use HasDynamicCrud;

    public static function crudFields(): array
    {
        return [
            'title' => [
                'type' => 'text',
                'label' => 'Title',
                'rules' => 'required|max:255',
                'list' => true,  // Show in list view
                'form' => true,  // Show in create/edit form
            ],
            'body' => [
                'type' => 'textarea',
                'label' => 'Content',
                'rules' => 'required',
                'list' => false,
                'form' => true,
            ],
            'status' => [
                'type' => 'select',
                'label' => 'Status',
                'options' => ['draft' => 'Draft', 'published' => 'Published'],
                'rules' => 'required|in:draft,published',
                'list' => true,
                'form' => true,
            ],
            'featured_image' => [
                'type' => 'image',
                'label' => 'Featured Image',
                'rules' => 'nullable|image|max:2048',
                'list' => true,
                'form' => true,
            ],
        ];
    }
}
```

Register the resource in `config/lyrapanel.php`:

```
'resources' => [
    'posts' => [
        'model' => \App\Models\Post::class,
        'label' => 'Posts',
        'icon' => 'document',
    ],
],
```

Supported field types: `text`, `textarea`, `number`, `email`, `select`, `boolean`, `date`, `datetime`, `image`, `file`.

### User Suspension

[](#user-suspension)

```
// Suspend a user
$user->suspend('Violation of terms', now()->addDays(7));

// Unsuspend
$user->unsuspend();

// Check status
$user->isSuspended(); // bool
```

### Audit Logging

[](#audit-logging)

```
use Rynbd\LyraPanel\Support\AuditLogger;

// Manual logging
AuditLogger::log('custom_action', $model, 'Description of what happened');

// With old/new values
AuditLogger::logUpdate($model, $oldValues, $newValues);
```

### Impersonation

[](#impersonation)

Admins can impersonate users from the Users management page. A yellow banner shows when impersonating, with a "Return to Admin" button.

Route Structure
---------------

[](#route-structure)

RouteDescription`/panel/admin`Admin Dashboard`/panel/admin/users`User Management`/panel/admin/roles`Role Management`/panel/admin/privileges`Privilege Management`/panel/admin/resources/{resource}`Dynamic CRUD`/panel/admin/audit`Audit Logs`/panel/admin/settings`Settings`/panel/admin/invitations`Invitations`/panel/user`User Dashboard`/panel/user/profile`User ProfileCustomization
-------------

[](#customization)

### Views

[](#views)

Publish views for customization:

```
php artisan vendor:publish --tag=lyrapanel-views
```

### Theme

[](#theme)

The package uses shadcn/ui-inspired CSS variables. Customize in the published layout files or override in your CSS:

```
:root {
    --primary: #3b82f6;
    --background: #ffffff;
    --foreground: #0f172a;
}
.dark {
    --primary: #3b82f6;
    --background: #0f172a;
    --foreground: #f8fafc;
}
```

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.# lyra-panel

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance88

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

63d ago

### Community

Maintainers

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

---

Top Contributors

[![MdRaihanHasan](https://avatars.githubusercontent.com/u/72838529?v=4)](https://github.com/MdRaihanHasan "MdRaihanHasan (6 commits)")

---

Tags

laravelrbaccrudUser managementdashboardadminpanel

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/rynbd-lyrapanel/health.svg)

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

###  Alternatives

[tuandm/laravue

A beautiful dashboard for Laravel built by VueJS

2.2k16.6k](/packages/tuandm-laravue)[badaso/core

The API &amp; platform builder, build your apps 10x faster even more, it's open source &amp; 100% free !

1.3k16.2k10](/packages/badaso-core)[hasinhayder/tyro

Tyro - The ultimate Authentication, Authorization, and Role &amp; Privilege Management solution for Laravel 12 &amp; 13

6712.1k2](/packages/hasinhayder-tyro)[smarch/watchtower

Front-end for the Shinboi Auth system of Users / Roles / Permissions in Laravel 5

523.0k](/packages/smarch-watchtower)

PHPackages © 2026

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