PHP code example of michaeld555 / filament-croppie

1. Go to this page and download the library: Download michaeld555/filament-croppie 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/ */

    

michaeld555 / filament-croppie example snippets


use Michaeld555\FilamentCroppie\Components\Croppie;

Croppie::make('avatar')
    ->label('Avatar') // Field label
    ->disk('public') // Storage disk
    ->directory('avatars') // Storage directory
    // ... other configuration options

Croppie::make('profile_picture')
    ->label('Profile Picture')
    ->disk('s3')
    ->directory('profile-images')
    ->imageResizeTargetWidth(400)
    ->imageResizeTargetHeight(400);

Croppie::make('user_avatar')
    ->avatar()
    ->modalSize('5xl')
    ->modalDescription('Please upload a square image for optimal results.');

Croppie::make('product_image')
    ->viewportType('square')
    ->viewportHeight(250)
    ->viewportWidth(250)
    ->enableZoom(false)
    ->imageFormat('webp');
bash
php artisan vendor:publish --tag="filament-croppie-config"
bash
php artisan filament-croppie:install