PHP code example of nuhel / filament-croppie
1. Go to this page and download the library: Download nuhel/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/ */
nuhel / filament-croppie example snippets
Croppie::make('image')
->getUploadedFileNameForStorageUsing(function (TemporaryUploadedFile $file): string {
return (string)str("image_path/" . $file->hashName());
})->enableDownload()
->enableOpen()
->imageResizeTargetWidth('1000')
->imageResizeTargetHeight('800'),
Croppie::make('avatar')->avatar()
->enableOpen()->enableDownload()
->imageResizeTargetWidth('300')
->imageResizeTargetHeight('300')
->modalSize('xl'),
Croppie::make('avatar')->avatar()
->enableOpen()->enableDownload()
->imageResizeTargetWidth('300')
->imageResizeTargetHeight('300')
->keepOriginalSize()
->modalSize('xl'),
Croppie::make('avatar')->avatar()
->enableOpen()->enableDownload()
->imageResizeTargetWidth('300')
->imageResizeTargetHeight('300')
->withBoundary('30')
->modalSize('xl'),
Croppie::make('background')
->enableDownload()
->enableOpen()
->imageResizeTargetWidth('1000')
->imageResizeTargetHeight('400')
->modalSize('6xl')
->modalHeading("Crop Background Image")