Shofy - eCommerce & Multivendor Marketplace Laravel Platform - Biggest Offer! Only $59 - Get it here!
Static Assets S3 Upload

Static Assets S3 Upload

Upload static assets from public folder to S3 storage using database credentials

This product isn't released.

Downloads

0

License

MIT

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

  1. Copy the plugin folder to platform/plugins/static-assets-s3/
  2. Add ASSET_URL=https://your-bucket.s3.us-east-1.amazonaws.com in .env
  3. Activate the plugin in the admin panel: Settings > Plugins
  4. Configure S3 in Settings > Media

Usage

Admin Panel Interface

  1. Go to Settings > General in the admin panel
  2. Scroll to the bottom of the page to find the "Publish Static Assets to S3" section
  3. Select the folders you want to upload (vendor, themes, storage)
  4. Choose upload options (force upload, etc.)
  5. 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.