PHP code example of pjedesigns / filament-image-editor
1. Go to this page and download the library: Download pjedesigns/filament-image-editor 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/ */
pjedesigns / filament-image-editor example snippets
use Pjedesigns\FilamentImageEditor\Forms\Components\ImageEditor;
public static function form(Form $form): Form
{
return $form->schema([
ImageEditor::make('avatar')
->label('Profile Picture')
->
ImageEditor::make('photo')
->disk('public')
->directory('photos')
->visibility('public')
->shouldPreserveFilenames() // Keep original filename (slugified)
ImageEditor::make('photo')
->shouldPreserveFilenames() // "My Vacation Photo.PNG" → "my-vacation-photo.jpg"
> // In your Model
> public function registerMediaCollections(): void
> {
> $this->addMediaCollection('avatar')
> ->singleFile(); // Required for ImageEditor
> }
>