A comprehensive file and document management system for Filament applications, featuring Google Drive-style permissions, automatic inheritance, and flexible access controls.
- 📁 File & Folder Management - Upload files, create folders, and organize content
- 🔗 External Links - Add and manage external links with descriptions (including video embeds)
- 👥 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, Favorites, and Search All
- 🏷️ Tags & Favorites - Organize items with tags and mark favorites for quick access
- ⚙️ Configurable Admin Access - Flexible admin role configuration
- 🎨 Filament Integration - Native Filament UI components and navigation
- 🏢 Multi-Tenancy Support - Optional team/organization scoping for all library content
You can install the package via composer:
composer require tapp/filament-libraryThe 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
}Warning
If you are using multi-tenancy please see the "Multi-Tenancy Support" instructions below before publishing and running migrations.
You can publish and run the migrations with:
php artisan vendor:publish --tag="filament-library-migrations"
php artisan migrateYou can publish the config file with:
php artisan vendor:publish --tag="filament-library-config"use Tapp\FilamentLibrary\FilamentLibraryPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
FilamentLibraryPlugin::make(),
]);
}// 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');
});
}The plugin automatically adds navigation items under "Resource Library":
- 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
- Favorites - Items you've marked as favorites
The plugin features a sophisticated permissions system inspired by Google Drive.
- 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
- Personal Folders - Automatically created for new users
- Permission Inheritance - Child items inherit parent folder permissions
- Admin Override - Library admins can access all content
Filament Library includes built-in support for multi-tenancy, allowing you to scope library items, permissions, and tags to specific tenants (e.g., teams, organizations, workspaces).
You MUST configure and enable tenancy in the config file BEFORE running the migrations. The migrations check the tenancy configuration to determine whether to add tenant columns to the database tables. If you enable tenancy after running migrations, you'll need to manually add the tenant columns to your database.
- Configure your Filament panel with tenancy (see Filament Tenancy docs)
- Publish the config file:
php artisan vendor:publish --tag="filament-library-config" - Enable tenancy in
config/filament-library.php:'tenancy' => [ 'enabled' => true, // ⚠️ Set this BEFORE running migrations! 'model' => \App\Models\Team::class, ],
- Run migrations:
php artisan migrate
For complete setup instructions, troubleshooting, and advanced configuration, see TENANCY.md.
The config file (config/filament-library.php) includes the following options:
'user_model' => env('FILAMENT_LIBRARY_USER_MODEL', 'App\\Models\\User'),Specify the user model for the application.
The library supports video links from various platforms. To customize supported domains, add this to your config:
'video' => [
'supported_domains' => [
'youtube.com',
'youtu.be',
'vimeo.com',
'wistia.com',
],
],Configure how long temporary download URLs remain valid:
'url' => [
'temporary_expiration_minutes' => 60, // Default: 60 minutes
],To configure which users can access admin features, add this to your config:
'admin_role' => 'Admin', // Role name to check
'admin_callback' => null, // Custom callback functionOr set it programmatically in your AppServiceProvider:
use Tapp\FilamentLibrary\FilamentLibraryPlugin;
public function boot()
{
FilamentLibraryPlugin::setLibraryAdminCallback(function ($user) {
return $user->hasRole('super-admin');
});
}Note: By default, users have an isLibraryAdmin() method that returns false. You can override this in your User model for custom logic.
composer testPlease see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.