tapp / filament-library
A Google Drive-like file management system for Filament
Fund package maintenance!
:vendor_name
Installs: 25
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 2
pkg:composer/tapp/filament-library
Requires
- php: ^8.3
- filament/filament: ^4.0
- filament/spatie-laravel-media-library-plugin: ^4.0
- illuminate/contracts: ^10.0|^11.0|^12.0
- spatie/laravel-medialibrary: ^11.0
- spatie/laravel-package-tools: ^1.15.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.0
- nunomaduro/collision: ^8.0
- orchestra/testbench: ^9.0|^10.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- phpstan/extension-installer: ^1.1
- spatie/laravel-ray: ^1.26
Conflicts
- phpunit/phpunit: >=11.0,<11.1
This package is auto-updated.
Last update: 2025-11-17 23:52:45 UTC
README
A comprehensive file and document management system for Filament applications, featuring Google Drive-style permissions, automatic inheritance, and flexible access controls.
Features
- 📁 File & Folder Management - Upload files, create folders, and organize content
- 🔗 External Links - Add and manage external links with descriptions
- 👥 Advanced Permissions - Google Drive-style ownership with Creator, Owner, Editor, and Viewer roles
- 🔄 Automatic Inheritance - Permissions automatically inherit from parent folders
- 🔍 Multiple Views - Public Library, My Documents, Shared with Me, Created by Me, and Search All
- ⚙️ Configurable Admin Access - Flexible admin role configuration
- 🎨 Filament Integration - Native Filament UI components and navigation
Installation
You can install the package via composer:
composer require tapp/filament-library
Database Setup
The package will automatically publish and run migrations. You'll need to add the LibraryUser trait to your User model:
// app/Models/User.php use Tapp\FilamentLibrary\Traits\LibraryUser; class User extends Authenticatable { use LibraryUser; // ... other traits and methods }
You can publish and run the migrations with:
php artisan vendor:publish --tag="filament-library-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="filament-library-config"
Basic Usage
1. Add to Filament Panel
use Tapp\FilamentLibrary\FilamentLibraryPlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ FilamentLibraryPlugin::make(), ]); }
2. Configure Admin Access
// In your AppServiceProvider use Tapp\FilamentLibrary\FilamentLibraryPlugin; public function boot() { // Option 1: Use different role name FilamentLibraryPlugin::setLibraryAdminCallback(function ($user) { return $user->hasRole('super-admin'); }); // Option 2: Custom logic FilamentLibraryPlugin::setLibraryAdminCallback(function ($user) { return $user->is_superuser || $user->hasRole('library-manager'); }); }
3. Navigation
The plugin automatically adds navigation items:
- Library - Main library view
- Search All - Search across all accessible content
- My Documents - Personal documents and folders
- Shared with Me - Items shared by other users
- Created by Me - Items you created
Permissions System
The plugin features a sophisticated permissions system inspired by Google Drive. See Permissions Documentation for complete details.
Quick Overview
- Creator - Permanent, always has access, cannot be changed
- Owner - Manages sharing, can be transferred, has full permissions
- Editor - Can view and edit content, cannot manage sharing
- Viewer - Can only view content
Automatic Permissions
- Personal Folders - Automatically created for new users
- Permission Inheritance - Child items inherit parent folder permissions
- Admin Override - Library admins can access all content
Configuration
Admin Role Configuration
// config/filament-library.php return [ 'admin_role' => 'Admin', // Default admin role 'admin_callback' => null, // Custom callback function ];
Environment Variables
LIBRARY_ADMIN_ROLE=super-admin
Documentation
- Permissions System - Complete permissions guide
- Customization Guide - Customizing admin access
- API Reference - Developer documentation
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.