generated from filamentphp/plugin-skeleton
-
-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Plugin Foundation & Basic Models #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Create LibraryItem model with Spatie Media Library integration - Create LibraryItemPermission model for user permissions - Add HasLibraryAccess trait for user model integration - Implement PermissionService with Google Drive-style inheritance - Add database migrations for library_items and permissions tables - Create configuration file with sensible defaults - Add test seeder for sample data - Update service provider and plugin structure - Fix MySQL constraint name length issues
- Create LibraryItemResource with proper Filament 4 syntax - Add resource pages (List, Create, Edit) - Register resource in FilamentLibraryPlugin - Fix type hints for navigationGroup and navigationIcon - Update form method to use Schema instead of Form - Add Library navigation group to admin panel
- Change navigation group to 'Resource Library' - Change navigation label to 'All Folders' - Update URL from /library-items to /library
- Add ViewAction as default row action - Create ViewLibraryItem page for file viewing - Implement folder navigation with parent parameter - Add breadcrumb navigation - Add 'Up One Level' action for subfolders - Update CreateLibraryItem to handle parent context - Show folder contents when clicking on folders - Show file view page when clicking on files
- Add separate 'Create Folder' and 'Upload File' modal actions - Create folder modal: name input only - Upload file modal: file upload only - Location is automatically set to current folder (cannot be changed) - Edit form simplified to only allow name changes - Remove type and parent_id from edit form (immutable after creation) - Fix auth()->id() calls to use auth()->user()?->id
- Change acceptedFileTypes from ['*'] to [] to properly allow all file types - Fixes 'File of invalid type' error for files like .textClipping - Update both modal action and resource fileForm method
- Remove acceptedFileTypes method entirely from FileUpload components - This is the correct way to allow all file types in Filament - Fixes validation error 'must be a file of type: .'
- Fix 'Call to a member function getClientOriginalName() on string' error - FileUpload component returns file path as string, not file object - Use basename() to extract filename from the stored file path - Update variable names for clarity
- Remove type field from mutateFormDataBeforeFill to keep it in form data - Add mutateFormDataBeforeSave to ensure type is preserved during save - Prevents type from becoming null when editing files/folders - Type is now immutable after creation but preserved during edits
- Remove type and parent_id from edit form completely - Type is now completely immutable after creation - Add dedicated 'Move' action for changing parent folder - Move action available in both table actions and edit page header - Move action prevents moving items into themselves or descendants - Edit form now only allows changing the name field - Clean separation of concerns: edit for name, move for location
- Replace resource editForm with inline schema containing only name field - Type and parent fields are now completely absent from edit form - Edit form now only shows the name input field - Ensures type and parent are never visible or editable in edit form
- Remove ->form() call that was pulling resource form - Use direct makeForm() to ensure only name field appears - Remove move and delete actions from table view - Keep only view and edit actions in table - Move and delete actions remain available in edit page header - Clean up unused imports
- Remove view action from table (clicking row still works for navigation) - Remove parent folder column from table - Remove type column from table - Add folder/file icons to name column - Green folder icon for folders, gray document icon for files - Keep only essential columns: name (with icon), created by, timestamps - Cleaner, more focused table interface
- Add recordUrl to table to restore row click behavior
- Clicking folder rows navigates to folder contents
- Clicking file rows opens file view page
- Add iconPosition('before') and iconSize('sm') for better icon placement
- Add extraAttributes with flex gap for proper spacing between icon and text
- Icons now have proper padding before the filename
- Remove iconSize('sm') method which doesn't exist on TextColumn
- Keep iconPosition('before') and extraAttributes for proper spacing
- Icons will still have proper spacing with gap-2 class
- Replace icon() method with formatStateUsing() for better control - Use custom HTML with flex layout and gap-2 for proper spacing - Icons now have consistent 4x4 size and proper colors - Green folder icons, gray document icons with proper padding
- Replace Blade component syntax with inline SVG icons - Folder icon: green folder SVG with proper path - Document icon: gray document SVG with proper path - Icons now display correctly with proper spacing
- Revert to using Filament's built-in icon() method which was working
- Keep iconPosition('before') and extraAttributes for spacing
- Icons should now display correctly with proper spacing
- Green folder icons, gray document icons
- Add custom CSS class 'library-item-name-column' to name column - Create filament-library.css with custom styling - Make both folder and document icons darker gray (gray-600) - Add proper spacing between icons and text (0.75rem gap + 0.5rem margin) - Update service provider to register custom CSS asset
- Change from outline icons (heroicon-o-*) to solid icons (heroicon-s-*) - Remove unnecessary margin-right from CSS since flexbox gap handles spacing - Keep CSS file for future use - Solid folder and document icons with proper spacing
- Use solid folder icons (heroicon-s-folder) for better visibility - Use outline document icons (heroicon-o-document) for contrast - Creates clearer visual distinction between folders and files - Solid folders stand out more, outline files are lighter
- Default columns: name, updated by, updated at - Optional columns: created by, created at, size (toggleable) - Add updated_by field to model and migration - Add updater relationship to LibraryItem model - Add formatFileSize helper method for file size display - Update all creation/update actions to set updated_by field - Size column shows '-' for folders, formatted file size for files
- Change 'Updated By' to 'Modified By' - Change 'Updated At' to 'Modified At' - Make 'Created By' and 'Size' columns toggleable (optional) - Default columns now: name, modified by, modified at
- Make all columns toggleable except name (which is always visible) - Set default visibility: name, modified by, modified at (visible) - Hide by default: created by, created at, size (optional) - Users can customize column visibility as needed
- Add getModelLabel() method to show 'File' for files, 'Folder' for folders - Add getPluralModelLabel() method to show 'Library' for plural - Labels now dynamically change based on the record type - Improves user experience with context-appropriate labels
- Remove getRecord() call from resource level (method doesn't exist) - Add getTitle() methods to EditLibraryItem and ViewLibraryItem pages - Dynamic labels now work: 'Edit File', 'Edit Folder', 'View File', 'View Folder' - Fixes the method not found error while maintaining dynamic functionality
- Change create folder action color from green (success) to blue (primary) - More standard color for primary create actions - Better visual hierarchy and consistency
- Replace separate 'Create Folder' and 'Upload File' buttons with single '+ New' dropdown - Dropdown contains both 'Create Folder' and 'Upload File' actions - Cleaner, more organized interface with single primary action button - Maintains all existing functionality while improving UX
…ibility - Replace incorrect ->dropdown() method with ActionGroup::make() - Add ActionGroup import to support dropdown functionality - Maintain same UI/UX with proper Filament 4 API usage - Fixes 'Method dropdown does not exist' error
- Change label from '+ New' to 'New' since plus icon is already present - Cleaner, less redundant button text - Icon provides visual indication of creation action
- Remove size column from table columns array - Remove unused formatFileSize helper method - Simplifies table view by removing file size information - Users can still see file details in the view page if needed
- Add 'View Folder' action to EditLibraryItem page header actions - Add 'View Folder' action to ViewLibraryItem page header actions - Action only appears when item has a parent folder - Uses arrow-up icon and gray color for consistency - Allows users to navigate back to parent folder from individual item pages
- Add getBreadcrumbs() method to EditLibraryItem page - Add getBreadcrumbs() method to ViewLibraryItem page - Breadcrumbs show full folder hierarchy from root to current item - Includes current item name as final breadcrumb - Consistent navigation experience across all library pages
- Add caching to breadcrumb generation (5 minute cache) - Optimize URL generation in breadcrumbs using string concatenation - Cache record URL generation (1 minute cache) - Reduce computational overhead during rapid folder navigation - Prevents Chrome throttling warnings when quickly navigating nested folders
- Add TrashedFilter for viewing soft-deleted items - Add RestoreAction and ForceDeleteAction for individual items - Add RestoreBulkAction and ForceDeleteBulkAction for bulk operations - Use Filament's built-in soft delete filter instead of custom implementation - Provides complete soft delete management for library items
- Remove custom ->visible() logic for EditAction, RestoreAction, and ForceDeleteAction - Test if Filament's default behavior handles soft delete action visibility automatically - Simplifies code by relying on built-in Filament functionality
- Fix Filament 3 compatibility issues (Schema -> Form) - Update PHPStan configuration to ignore plugin-specific issues - Fix test configuration and namespace references - Remove deprecated media conversion methods - Fix return type annotations - All tests and static analysis now passing
- Keep consistent string concatenation formatting - Remove Git conflict markers
…twork/Filament-Library into feature/plugin-foundation
- Add missing $latestResponse property declaration - Import TestResponse class for proper typing - Resolves CI test failures with Orchestra Testbench 9.0
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR establishes the core foundation for the Filament Library plugin, implementing the basic models, database schema, and essential functionality as outlined in PR 1 of the implementation plan.
Features Implemented
🗄️ Database Schema
🏗️ Core Models
🔐 Permission System
📁 Filament Resource
📄 Pages & Forms
⚙️ Configuration
🧪 Testing Support
Technical Highlights
Performance Optimizations
User Experience
Code Quality
Database Changes
Configuration
Next Steps
This foundation enables the next phase of development:
Testing
Closes #[issue-number] (if applicable)