PHP code example of rayzenai / file-manager

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/ */

    

rayzenai / file-manager example snippets


    composer 

    php artisan vendor:publish --tag="file-manager-config"
    

    

    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'),