
Static Assets S3 Upload
by RING PUNJAB
•
(0)
Upload static assets from public folder to S3 storage using database credentials
This product isn't released.
Downloads
0
License
Static Assets S3 Upload Plugin
A Botble CMS plugin that provides a command and admin interface to upload static assets from the public folder to S3 storage using database credentials.
Features
- Upload static assets (vendor, themes, storage folders) to S3
- Uses S3 credentials stored in database settings
- Admin Panel Interface with publish button in Settings
- Supports custom folder selection
- Dry run mode for preview
- Force upload option to overwrite existing files
- Comprehensive error handling and progress feedback
- AJAX-based upload with real-time progress
Installation
- Copy the plugin folder to
platform/plugins/static-assets-s3/
- Add
ASSET_URL=https://your-bucket.s3.us-east-1.amazonaws.com
in.env
- Activate the plugin in the admin panel: Settings > Plugins
- Configure S3 in Settings > Media
Usage
Admin Panel Interface
- Go to Settings > General in the admin panel
- Scroll to the bottom of the page to find the "Publish Static Assets to S3" section
- Select the folders you want to upload (vendor, themes, storage)
- Choose upload options (force upload, etc.)
- Click "Publish to S3" to upload or "Dry Run" to preview
Command Line Usage
Basic Usage
php artisan cms:publish:static-assets-to-s3
Custom Folders
php artisan cms:publish:static-assets-to-s3 --folders=vendor,themes
Force Upload
php artisan cms:publish:static-assets-to-s3 --force
Dry Run (Preview)
php artisan cms:publish:static-assets-to-s3 --dry-run
Prerequisites
- S3 configured as media driver in Settings > Media
- S3 credentials stored in database settings
Plugin Structure
static-assets-s3/
├── plugin.json
├── src/
│ ├── Plugin.php
│ ├── Commands/
│ │ └── PublishStaticAssetsToS3Command.php
│ ├── Http/
│ │ └── Controllers/
│ │ └── StaticAssetsS3Controller.php
│ └── Providers/
│ ├── StaticAssetsS3ServiceProvider.php
│ └── HookServiceProvider.php
├── resources/
│ ├── lang/
│ │ └── en/
│ │ └── static-assets-s3.php
│ └── views/
│ └── partials/
│ └── publish-button.blade.php
├── routes/
│ └── web.php
└── README.md
Admin Panel Integration
The plugin integrates seamlessly with the Botble CMS admin panel:
- Settings Page: Publish button appears in Settings > General
- Real-time Progress: Shows upload progress with AJAX
- Error Handling: Displays detailed error messages
- User-friendly Interface: Intuitive folder selection and options
API Endpoints
POST /admin/static-assets-s3/publish
- AJAX endpoint for publishing assets
License
This plugin is part of Botble CMS and follows the same license terms.
Kindly log in to share your feedback on this plugin.