1. Go to this page and download the library: Download rayzenai/file-manager 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/ */
return [
'User' => 'users', // Define other models and their path names here according to your project
];
use Kirantimsina\FileManager\Traits\HasImages;
class YourModel extends Model implements InterfacesHasImages
{
use HasFactory, HasImages;
protected $guarded = ['id']; // This protects the 'id' field
// We define the 'images' field as an array
protected $casts = [
'images' => 'array',
];
// Specify which fields in this model will handle images
protected function hasImagesTraitFields(): array
{
return ['images'];
}
}
ImageUpload::make('images')
->label('Images'),
S3Image::make('images')
->label('Images'),
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.