PHP code example of amjadiqbal / filament-url-image-uploader
1. Go to this page and download the library: Download amjadiqbal/filament-url-image-uploader 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/ */
amjadiqbal / filament-url-image-uploader example snippets
use AmjadIqbal\FilamentUrlImageUploader\Components\UrlImageUploader;
UrlImageUploader::make('image')->directory('images');
// database column: image (string, nullable)
class Post extends Model
{
protected $fillable = ['image'];
}
Storage::disk('public')->url($post->image);
UrlImageUploader::make('image')->directory('custom/path/here');
UrlImageUploader::make('image')->disk('s3');
UrlImageUploader::make('image')->preserveFilenames();
UrlImageUploader::make('image')->maxUrlFetchSize(5 * 1024 * 1024); // 5 MB
use Filament\Forms\Components\Repeater;
Repeater::make('gallery')
->schema([
UrlImageUploader::make('image')->directory('gallery'),
])
->reorderable()
->addable()
->deletable();
bash
php artisan vendor:publish --tag="filament-url-image-uploader-translations"