PHP code example of happenv-com / filament-multi-source-upload
1. Go to this page and download the library: Download happenv-com/filament-multi-source-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/ */
happenv-com / filament-multi-source-upload example snippets
use Happenv\FilamentMultiSourceUpload\MultiSourceFileUpload;
MultiSourceFileUpload::make('logo_path')
->image()
->disk('s3')
->directory('logos');
MultiSourceFileUpload::make('document')
->acceptedFileTypes(['application/pdf'])
->disk('documents')
->maxUrlImportSize(10 * 1024) // 10 MB
->urlTabLabel('Paste a link');
use Happenv\FilamentMultiSourceUpload\MultiSourceFileUpload;
MultiSourceFileUpload::make('avatar')
->image()
->avatar()
->disk('public')
->directory('avatars')
->maxSize(2048);
MultiSourceFileUpload::make('gallery')
->image()
->multiple()
->maxFiles(10)
->disk('s3')
->directory('gallery');
MultiSourceFileUpload::make('logo_path')
->urlImport(fn (): bool => auth()->user()->canImportFromUrl());
bash
php artisan vendor:publish --tag="filament-multi-source-upload-translations"
php artisan vendor:publish --tag="filament-multi-source-upload-views"