A Laravel application demonstrating Filament PHP admin panel with remote storage integration using MinIO (local/staging) and AWS S3 (production), powered by Spatie Media Library.
- Filament PHP Admin Panel - Modern, beautiful admin interface
- Remote Storage Integration - Seamless switching between MinIO and S3
- Media Library - Advanced file management with Spatie Media Library
- Image Processing - Automatic image conversions and thumbnails
- ULID Support - Unique identifier generation for posts
- Slug Generation - Auto-generated SEO-friendly URLs
- Docker Support - Easy MinIO setup with Docker Compose
- PHP ^8.2
- Composer
- Node.js & NPM
- Docker & Docker Compose (for MinIO)
- SQLite (default) or MySQL/PostgreSQL
git clone <repository-url>
cd filament-remote-storagecomposer install
npm installCopy the example environment file:
cp .env.example .env
php artisan key:generateThe .env file is pre-configured for MinIO. Update if needed:
FILESYSTEM_DISK=s3
AWS_ACCESS_KEY_ID=minioadmin
AWS_SECRET_ACCESS_KEY=minioadmin
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=filament-media
AWS_ENDPOINT=http://localhost:9000
AWS_USE_PATH_STYLE_ENDPOINT=true
AWS_URL=http://localhost:9000/filament-mediaUpdate your .env file with your AWS credentials:
FILESYSTEM_DISK=s3
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=your-production-bucket
AWS_ENDPOINT=
AWS_USE_PATH_STYLE_ENDPOINT=false
AWS_URL=https://your-bucket.s3.amazonaws.comdocker-compose up -dThis will:
- Start MinIO server on port 9000
- Start MinIO console on port 9001
- Automatically create the
filament-mediabucket - Set the bucket to public access
Access MinIO Console:
- URL: http://localhost:9001
- Username:
minioadmin - Password:
minioadmin
php artisan migratephp artisan storage:linkphp artisan serveOr use the dev script for concurrent services:
composer run devThis runs:
- Laravel server
- Queue worker
- Vite dev server
filament-remote-storage/
βββ app/
β βββ Filament/
β β βββ Resources/
β β βββ PostResource.php # Filament resource for posts
β βββ Models/
β βββ Post.php # Post model with media library
βββ config/
β βββ filesystems.php # Storage configuration
β βββ media-library.php # Media library configuration
βββ database/
β βββ migrations/
β βββ create_posts_table.php # Posts table migration
βββ docker-compose.yml # MinIO Docker setup
βββ .env # Environment configuration
- Start the development server:
php artisan serve - Navigate to:
http://localhost:8000/admin - Log in with your admin credentials
- Navigate to Posts in the admin panel
- Click Create Post
- Fill in the form:
- Title - Auto-generates slug
- Slug - SEO-friendly URL (editable)
- ULID - Auto-generated unique identifier
- Content - Rich text editor
- Published At - Optional publication date
- Featured Image - Single image with conversions
- Image Gallery - Multiple images (up to 10)
- Documents - PDF and Word documents
The Post model includes three media collections:
-
featured_image - Single file collection
- Thumbnail conversion (300x300)
- Medium conversion (800x600)
-
gallery - Multiple file collection
- Thumbnail conversion (200x200)
-
documents - Multiple file collection
- No conversions (original files)
The config/filesystems.php file includes an S3 disk configured for both MinIO and AWS S3:
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false,
'visibility' => 'public',
],The config/media-library.php uses the FILESYSTEM_DISK environment variable:
'disk_name' => env('FILESYSTEM_DISK', 's3'),Run the test suite:
composer testOr with Pest:
php artisan test- Laravel 12 - PHP framework
- Filament 4 - Admin panel
- Spatie Media Library - File management
- MinIO - S3-compatible object storage
- AWS S3 - Production storage
- Docker - Containerization
- Pest - Testing framework
Image conversions are processed via queues. Configure in .env:
QUEUE_CONNECTION=databaseFor synchronous processing (development):
QUEUE_CONNECTION=syncRun queue worker:
php artisan queue:workdocker-compose up -ddocker-compose downdocker-compose logs -f miniodocker-compose down -v- Never commit
.envfile to version control - Use strong credentials for production S3 buckets
- Configure proper IAM roles for AWS S3 access
- Set appropriate bucket policies for public/private access
This project is open-sourced software licensed under the MIT license.
Contributions are welcome! Please feel free to submit a Pull Request.
- Ensure MinIO is running:
docker-compose ps - Check MinIO logs:
docker-compose logs minio - Verify bucket exists in MinIO console
- Check
.envconfiguration matches MinIO settings
- Ensure queue worker is running:
php artisan queue:work - Check queue connection in
.env - Verify image driver is installed (GD or Imagick)
- Check application logs:
storage/logs/laravel.log
If using local storage, ensure the symbolic link exists:
php artisan storage:link- Clone the repository
- Install dependencies:
composer install && npm install - Copy
.env.exampleto.envand configure - Start MinIO:
docker-compose up -d - Run migrations:
php artisan migrate - Start server:
php artisan serve - Access admin panel: http://localhost:8000/admin
Enjoy building with Filament and remote storage! π