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')
    ->disk('public')
    ->directory('avatars');

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

Croppie::make('user_avatar')
    ->avatar()
    ->forceCircleResult(true)
    ->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');

use Michaeld555\FilamentCroppie\Components\SpatieMediaLibraryCroppie;

SpatieMediaLibraryCroppie::make('avatar')
    ->collection('portraits')
    ->viewportType('square');
bash
php artisan vendor:publish --tag="filament-croppie-config"
bash
php artisan filament-croppie:install