Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github: :vendor_name
github: TappNetwork
2 changes: 1 addition & 1 deletion .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Security Policy

If you discover any security related issues, please email author@domain.com instead of using the issue tracker.
If you discover any security related issues, please email steve@tappnetwork.com instead of using the issue tracker.
3 changes: 3 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Details

Details of the feature / fix this PR addresses.
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.3'
coverage: none

- name: Install composer dependencies
Expand Down
106 changes: 89 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ A comprehensive file and document management system for Filament applications, f
## Features

- **📁 File & Folder Management** - Upload files, create folders, and organize content
- **🔗 External Links** - Add and manage external links with descriptions
- **🔗 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, and Search All
- **🔍 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

## Installation

Expand All @@ -35,6 +37,9 @@ class User extends Authenticatable
}
```

> [!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:

```bash
Expand Down Expand Up @@ -86,16 +91,17 @@ public function boot()

### 3. Navigation

The plugin automatically adds navigation items:
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

## Permissions System

The plugin features a sophisticated permissions system inspired by Google Drive. See [Permissions Documentation](docs/permissions.md) for complete details.
The plugin features a sophisticated permissions system inspired by Google Drive.

### Quick Overview

Expand All @@ -110,29 +116,95 @@ The plugin features a sophisticated permissions system inspired by Google Drive.
- **Permission Inheritance** - Child items inherit parent folder permissions
- **Admin Override** - Library admins can access all content

## Multi-Tenancy Support

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).

### ⚠️ Important: Enable Tenancy Before Migrations

**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.

### Quick Setup

1. **Configure your Filament panel with tenancy** (see [Filament Tenancy docs](https://filamentphp.com/docs/4.x/users/tenancy))
2. **Publish the config file**:
```bash
php artisan vendor:publish --tag="filament-library-config"
```
3. **Enable tenancy in `config/filament-library.php`**:
```php
'tenancy' => [
'enabled' => true, // ⚠️ Set this BEFORE running migrations!
'model' => \App\Models\Team::class,
],
```
4. **Run migrations**:
```bash
php artisan migrate
```

For complete setup instructions, troubleshooting, and advanced configuration, see [TENANCY.md](TENANCY.md).

## Configuration

### Admin Role Configuration
The config file (`config/filament-library.php`) includes the following options:

### User Model

```php
// config/filament-library.php
return [
'admin_role' => 'Admin', // Default admin role
'admin_callback' => null, // Custom callback function
];
'user_model' => env('FILAMENT_LIBRARY_USER_MODEL', 'App\\Models\\User'),
```

### Environment Variables
Specify the user model for the application.

```env
LIBRARY_ADMIN_ROLE=super-admin
### Video Link Support (Optional)

The library supports video links from various platforms. To customize supported domains, add this to your config:

```php
'video' => [
'supported_domains' => [
'youtube.com',
'youtu.be',
'vimeo.com',
'wistia.com',
],
],
```

### Secure File URLs (Optional)

Configure how long temporary download URLs remain valid:

```php
'url' => [
'temporary_expiration_minutes' => 60, // Default: 60 minutes
],
```

## Documentation
### Admin Access Configuration (Optional)

To configure which users can access admin features, add this to your config:

```php
'admin_role' => 'Admin', // Role name to check
'admin_callback' => null, // Custom callback function
```

Or set it programmatically in your `AppServiceProvider`:

```php
use Tapp\FilamentLibrary\FilamentLibraryPlugin;

public function boot()
{
FilamentLibraryPlugin::setLibraryAdminCallback(function ($user) {
return $user->hasRole('super-admin');
});
}
```

- [Permissions System](docs/permissions.md) - Complete permissions guide
- [Customization Guide](docs/customization.md) - Customizing admin access
- [API Reference](docs/api.md) - Developer documentation
**Note:** By default, users have an `isLibraryAdmin()` method that returns `false`. You can override this in your User model for custom logic.

## Testing

Expand Down
Loading
Loading