Skip to content

Commit de71afe

Browse files
authored
Merge pull request #2 from TappNetwork/feature/plugin-foundation
feat: Plugin Foundation & Basic Models
2 parents fb731cd + 2515e26 commit de71afe

36 files changed

+1749
-186
lines changed

.github/workflows/fix-php-code-style-issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
steps:
1616
- name: Checkout code
17-
uses: actions/checkout@v4
17+
uses: actions/checkout@v5
1818
with:
1919
ref: ${{ github.head_ref }}
2020

.github/workflows/phpstan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ jobs:
1111
name: phpstan
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v5
1515

1616
- name: Setup PHP
1717
uses: shivammathur/setup-php@v2
1818
with:
19-
php-version: '8.1'
19+
php-version: '8.2'
2020
coverage: none
2121

2222
- name: Install composer dependencies

.github/workflows/run-tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ jobs:
1313
fail-fast: true
1414
matrix:
1515
os: [ubuntu-latest, windows-latest]
16-
php: [8.2, 8.1]
17-
laravel: [10.*]
16+
php: [8.2, 8.3]
17+
laravel: [11.*]
1818
stability: [prefer-lowest, prefer-stable]
1919
include:
20-
- laravel: 10.*
21-
testbench: 8.*
20+
- laravel: 11.*
21+
testbench: 9.*
2222
carbon: 2.*
2323

2424
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
2525

2626
steps:
2727
- name: Checkout code
28-
uses: actions/checkout@v4
28+
uses: actions/checkout@v5
2929

3030
- name: Setup PHP
3131
uses: shivammathur/setup-php@v2

.github/workflows/update-changelog.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
steps:
1515
- name: Checkout code
16-
uses: actions/checkout@v4
16+
uses: actions/checkout@v5
1717
with:
1818
ref: main
1919

composer.json

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,39 @@
11
{
2-
"name": ":vendor_slug/:package_slug",
3-
"description": ":package_description",
2+
"name": "tapp/filament-library",
3+
"description": "A Google Drive-like file management system for Filament",
44
"keywords": [
5-
":vendor_name",
5+
"tapp",
66
"laravel",
7-
":package_slug"
7+
"filament",
8+
"library",
9+
"file-management"
810
],
9-
"homepage": "https://github.com/:vendor_slug/:package_slug",
11+
"homepage": "https://github.com/TappNetwork/Filament-Library",
1012
"support": {
11-
"issues": "https://github.com/:vendor_slug/:package_slug/issues",
12-
"source": "https://github.com/:vendor_slug/:package_slug"
13+
"issues": "https://github.com/TappNetwork/Filament-Library/issues",
14+
"source": "https://github.com/TappNetwork/Filament-Library"
1315
},
1416
"license": "MIT",
1517
"authors": [
1618
{
17-
"name": ":author_name",
18-
"email": "author@domain.com",
19+
"name": "Tapp Network",
20+
"email": "dev@tappnetwork.com",
1921
"role": "Developer"
2022
}
2123
],
2224
"require": {
2325
"php": "^8.1",
24-
"filament/filament": "^3.0",
25-
"filament/forms": "^3.0",
26-
"filament/tables": "^3.0",
27-
"spatie/laravel-package-tools": "^1.15.0"
26+
"filament/filament": "^4.0",
27+
"illuminate/contracts": "^10.0|^11.0",
28+
"spatie/laravel-package-tools": "^1.15.0",
29+
"spatie/laravel-medialibrary": "^11.0",
30+
"filament/spatie-laravel-media-library-plugin": "^4.0"
2831
},
2932
"require-dev": {
3033
"laravel/pint": "^1.0",
31-
"nunomaduro/collision": "^7.9",
34+
"nunomaduro/collision": "^8.0",
3235
"nunomaduro/larastan": "^2.0.1",
33-
"orchestra/testbench": "^8.0",
36+
"orchestra/testbench": "^9.0",
3437
"pestphp/pest": "^2.1",
3538
"pestphp/pest-plugin-arch": "^2.0",
3639
"pestphp/pest-plugin-laravel": "^2.0",
@@ -41,13 +44,13 @@
4144
},
4245
"autoload": {
4346
"psr-4": {
44-
"VendorName\\Skeleton\\": "src/",
45-
"VendorName\\Skeleton\\Database\\Factories\\": "database/factories/"
47+
"Tapp\\FilamentLibrary\\": "src/",
48+
"Tapp\\FilamentLibrary\\Database\\Factories\\": "database/factories/"
4649
}
4750
},
4851
"autoload-dev": {
4952
"psr-4": {
50-
"VendorName\\Skeleton\\Tests\\": "tests/"
53+
"Tapp\\FilamentLibrary\\Tests\\": "tests/"
5154
}
5255
},
5356
"scripts": {
@@ -67,10 +70,10 @@
6770
"extra": {
6871
"laravel": {
6972
"providers": [
70-
"VendorName\\Skeleton\\SkeletonServiceProvider"
73+
"Tapp\\FilamentLibrary\\FilamentLibraryServiceProvider"
7174
],
7275
"aliases": {
73-
"Skeleton": "VendorName\\Skeleton\\Facades\\Skeleton"
76+
"FilamentLibrary": "Tapp\\FilamentLibrary\\Facades\\FilamentLibrary"
7477
}
7578
}
7679
},

config/filament-library.php

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
<?php
2+
3+
return [
4+
/*
5+
|--------------------------------------------------------------------------
6+
| Library Configuration
7+
|--------------------------------------------------------------------------
8+
|
9+
| Configuration options for the Filament Library plugin.
10+
|
11+
*/
12+
13+
/*
14+
|--------------------------------------------------------------------------
15+
| Maximum Nesting Depth
16+
|--------------------------------------------------------------------------
17+
|
18+
| The maximum number of levels deep that folders can be nested.
19+
| Set to null for unlimited nesting.
20+
|
21+
*/
22+
'max_nesting_depth' => 5,
23+
24+
/*
25+
|--------------------------------------------------------------------------
26+
| Soft Delete Days
27+
|--------------------------------------------------------------------------
28+
|
29+
| Number of days to keep soft-deleted items before permanent deletion.
30+
| Set to null to disable automatic cleanup.
31+
|
32+
*/
33+
'soft_delete_days' => 30,
34+
35+
/*
36+
|--------------------------------------------------------------------------
37+
| Table Columns
38+
|--------------------------------------------------------------------------
39+
|
40+
| Configuration for which columns to show in the library table.
41+
|
42+
*/
43+
'table_columns' => [
44+
'name' => true,
45+
'type' => true,
46+
'size' => true,
47+
'created_at' => true,
48+
'updated_at' => false,
49+
],
50+
51+
/*
52+
|--------------------------------------------------------------------------
53+
| File Operations
54+
|--------------------------------------------------------------------------
55+
|
56+
| Configuration for file upload and handling.
57+
|
58+
*/
59+
'file_operations' => [
60+
'allowed_mime_types' => [
61+
'image/*',
62+
'application/pdf',
63+
'text/*',
64+
'application/msword',
65+
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
66+
'application/vnd.ms-excel',
67+
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
68+
'application/vnd.ms-powerpoint',
69+
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
70+
'application/zip',
71+
'application/x-rar-compressed',
72+
],
73+
'max_file_size' => 50 * 1024 * 1024, // 50MB default
74+
],
75+
76+
/*
77+
|--------------------------------------------------------------------------
78+
| Media Library Configuration
79+
|--------------------------------------------------------------------------
80+
|
81+
| Configuration for Spatie Media Library integration.
82+
| Most settings are handled by the Media Library's own configuration.
83+
|
84+
*/
85+
'media_library' => [
86+
'collection_name' => 'files',
87+
'conversion_name' => 'thumb',
88+
'disk' => null, // Use Media Library's default disk
89+
],
90+
91+
/*
92+
|--------------------------------------------------------------------------
93+
| Permission Configuration
94+
|--------------------------------------------------------------------------
95+
|
96+
| Configuration for permission handling and caching.
97+
|
98+
*/
99+
'permissions' => [
100+
'cache_ttl' => 3600, // 1 hour
101+
'auto_inherit' => true, // Automatically inherit parent permissions
102+
'cascade_on_change' => true, // Cascade permission changes to children
103+
],
104+
105+
/*
106+
|--------------------------------------------------------------------------
107+
| User Model Configuration
108+
|--------------------------------------------------------------------------
109+
|
110+
| Configuration for user model integration.
111+
|
112+
*/
113+
'user_model' => \App\Models\User::class,
114+
115+
/*
116+
|--------------------------------------------------------------------------
117+
| Navigation Configuration
118+
|--------------------------------------------------------------------------
119+
|
120+
| Configuration for Filament navigation integration.
121+
|
122+
*/
123+
'navigation' => [
124+
'group' => 'Library',
125+
'icon' => 'heroicon-o-folder',
126+
'sort' => 10,
127+
],
128+
];

config/skeleton.php

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
Schema::create('library_items', function (Blueprint $table) {
15+
$table->id();
16+
$table->string('name');
17+
$table->string('slug');
18+
$table->enum('type', ['folder', 'file']);
19+
$table->foreignId('parent_id')->nullable()->constrained('library_items')->cascadeOnDelete();
20+
$table->foreignId('created_by')->constrained('users');
21+
$table->timestamps();
22+
$table->softDeletes();
23+
24+
$table->index(['parent_id', 'type']);
25+
$table->unique(['parent_id', 'slug'], 'lib_items_parent_slug_unique');
26+
});
27+
}
28+
29+
/**
30+
* Reverse the migrations.
31+
*/
32+
public function down(): void
33+
{
34+
Schema::dropIfExists('library_items');
35+
}
36+
};
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
Schema::create('library_item_permissions', function (Blueprint $table) {
15+
$table->id();
16+
$table->foreignId('library_item_id')->constrained()->cascadeOnDelete();
17+
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
18+
$table->enum('permission', ['view', 'edit']);
19+
$table->timestamps();
20+
21+
$table->unique(['library_item_id', 'user_id', 'permission'], 'lib_item_perms_unique');
22+
});
23+
}
24+
25+
/**
26+
* Reverse the migrations.
27+
*/
28+
public function down(): void
29+
{
30+
Schema::dropIfExists('library_item_permissions');
31+
}
32+
};

database/migrations/create_skeleton_table.php.stub

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)