PHP code example of spykapps / filament-uppy-upload
1. Go to this page and download the library: Download spykapps/filament-uppy-upload library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
spykapps / filament-uppy-upload example snippets
use SpykApp\UppyUpload\Forms\Components\UppyUpload;
UppyUpload::make('document')
->directory('documents')
UppyUpload::make('attachments')
->multiple()
->maxFiles(10)
->directory('attachments')
UppyUpload::make('avatar')
->image()
->imageEditor()
->maxFileSize(5 * 1024 * 1024)
->directory('avatars')
UppyUpload::make('files')
->disk('s3')
->directory('uploads')
->multiple()
UppyUpload::make('files')
->companionUrl('https://companion.yoursite.com')
->remoteSources(['GoogleDrive', 'OneDrive', 'Url'])
->directory('imports')
UppyUpload::make('archive')
->acceptedFileTypes(['application/zip', 'application/x-zip-compressed'])
->maxFileSize(500 * 1024 * 1024)
->directory('archives')
UppyUpload::make('files')
->disk('s3') // Any Laravel disk
->directory('uploads') // Storage directory
->multiple() // Allow multiple files
->maxFiles(20) // Max number of files
->minFiles(1) // Min number of files
->maxFileSize(100 * 1024 * 1024) // 100MB max per file
->chunkSize(5 * 1024 * 1024) // 5MB chunks
->acceptedFileTypes(['image/*']) // MIME types
->webcam(false) // Disable webcam
->screenCapture(false) // Disable screen capture
->audio(false) // Disable audio recording
->imageEditor(true) // Enable image editor
->autoOpenFileEditor() // Auto-open editor for images
->dragDrop(true) // Full-page drag & drop
->height(400) // Dashboard height in px
->theme('auto') // 'auto', 'light', or 'dark'
->locale('fr') // Override locale
->note('Upload your documents here') // Custom note text
->companionUrl('https://...') // Companion URL
->remoteSources(['GoogleDrive']) // Remote sources
->uploadEndpoint('/custom/upload') // Custom upload URL
->deleteEndpoint('/custom/delete') // Custom delete URL
use SpykApp\UppyUpload\UppyUploadPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugin(
UppyUploadPlugin::make()
->companionUrl('https://companion.yoursite.com')
->disk('s3')
);
}
return [
'disk' => env('UPPY_UPLOAD_DISK', 'public'),
'directory' => env('UPPY_UPLOAD_DIRECTORY', 'uploads'),
'chunk_size' => env('UPPY_UPLOAD_CHUNK_SIZE', 5 * 1024 * 1024),
'route_prefix' => env('UPPY_UPLOAD_ROUTE_PREFIX', 'uppy'),
'middleware' => ['web'],
'companion_url' => env('UPPY_COMPANION_URL', null),
'remote_sources' => ['GoogleDrive', 'OneDrive', 'Dropbox', 'Url'],
'uppy_version' => env('UPPY_VERSION', '5.2.1'),
];
bash
php artisan filament:assets
bash
php artisan vendor:publish --tag="uppy-upload-config"
bash
php artisan vendor:publish --tag="uppy-upload-translations"
bash
php artisan vendor:publish --tag="uppy-upload-views"
bash
php artisan vendor:publish --provider="SpykApp\UppyUpload\UppyUploadServiceProvider"