LaravelLover
1 week ago

UniSharp filemanager not working with laravel!

Posted 1 week ago by LaravelLover

Hello Guys

I'm having some issues with laravel 5.8.30 and unisharp file manager 2.0...

I can uploads files and they got to relevant folders but the file manager wont show it in the backend. Manually browsing the images wont show either!

My lfm.php looks something like this..

return [ /* |-------------------------------------------------------------------------- | Routing |-------------------------------------------------------------------------- */

'use_package_routes'       => false,

// // Use relative paths (without domain)
'relative_paths'           => false,

// The url to this package. Change it if necessary.
'url_prefix'               => config('admin.route.prefix') . '/uploads',

/*
|--------------------------------------------------------------------------
| Multi-User Mode
|--------------------------------------------------------------------------
 */

'allow_multi_user'         => false,

'allow_share_folder'       => false,

/*
|--------------------------------------------------------------------------
| Folder Names
|--------------------------------------------------------------------------
 */

// Flexible way to customize client folders accessibility
// If you want to customize client folders, publish tag="lfm_handler"
// Then you can rewrite userField function in App\Handler\ConfigHandler class
// And set 'user_field' to App\Handler\ConfigHandler::class
// Ex: The private folder of user will be named as the user id.
'user_folder_name'         => UniSharp\LaravelFilemanager\Handlers\ConfigHandler::class,

// 'shared_folder_name'       => 'shares',

'thumb_folder_name'        => 'thumbs',

'folder_categories'        => [
    'product'  => [
        'folder_name'  => 'product',
        'startup_view' => 'grid',
        'max_size'     => 30000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
        ],
    ],

    'category' => [
        'folder_name'  => 'category',
        'startup_view' => 'grid',
        'max_size'     => 30000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
        ],
    ],

    'brand'    => [
        'folder_name'  => 'brand',
        'startup_view' => 'grid',
        'max_size'     => 30000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
        ],
    ],

    'vendor'   => [
        'folder_name'  => 'vendor',
        'startup_view' => 'grid',
        'max_size'     => 30000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
        ],
    ],

    'language' => [
        'folder_name'  => 'language',
        'startup_view' => 'grid',
        'max_size'     => 30000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
        ],
    ],

    'currency' => [
        'folder_name'  => 'currency',
        'startup_view' => 'grid',
        'max_size'     => 30000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
        ],
    ],

    'logo'     => [
        'folder_name'  => 'logo',
        'startup_view' => 'grid',
        'max_size'     => 50000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
        ],
    ],

    'content'  => [
        'folder_name'  => 'content',
        'startup_view' => 'grid',
        'max_size'     => 30000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
        ],
    ],
    'page'     => [
        'folder_name'  => 'page',
        'startup_view' => 'grid',
        'max_size'     => 30000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
        ],
    ],

    'avatar'     => [
        'folder_name'  => 'avatar',
        'startup_view' => 'grid',
        'max_size'     => 30000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
        ],
    ],

    'other'    => [
        'folder_name'  => 'other',
        'startup_view' => 'grid',
        'max_size'     => 30000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
        ],
    ],

    'banner'   => [
        'folder_name'  => 'banner',
        'startup_view' => 'grid',
        'max_size'     => 50000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
        ],
    ],

    'file'     => [
        'folder_name'  => 'file',
        'startup_view' => 'list',
        'max_size'     => 50000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
            'application/pdf',
            'text/plain',
        ],
    ],

    'manager'  => [
        'folder_name'  => '',
        'startup_view' => 'list',
        'max_size'     => 50000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
            'application/pdf',
            'text/plain',
        ],
    ],
],

/*
|--------------------------------------------------------------------------
| Upload / Validation
|--------------------------------------------------------------------------
 */

'disk'                     => 'public',

'rename_file'              => false,

'alphanumeric_filename'    => false,

'alphanumeric_directory'   => false,

'should_validate_size'     => false,

'should_validate_mime'     => false,

// permissions to be set when create a new folder or when it creates automatically with thumbnails
'create_folder_mode'       => 0755,

// permissions to be set on file upload.
'create_file_mode'         => 0644,

// If true, it will attempt to chmod the file after upload
'should_change_file_mode'  => true,

// behavior on files with identical name
// setting it to true cause old file replace with new one
// setting it to false show `error-file-exist` error and stop upload
'over_write_on_duplicate'  => true,

/*
|--------------------------------------------------------------------------
| Thumbnail
|--------------------------------------------------------------------------
 */

// If true, image thumbnails would be created during upload
'should_create_thumbnails' => true,

// Create thumbnails automatically only for listed types.
'raster_mimetypes'         => [
    'image/jpeg',
    'image/pjpeg',
    'image/png',
],

'thumb_img_width'          => 200,

'thumb_img_height'         => 200,

/*
|--------------------------------------------------------------------------
| jQuery UI options
|--------------------------------------------------------------------------
 */

'resize_aspectRatio'       => false,

'resize_containment'       => true,

/*
|--------------------------------------------------------------------------
| File Extension Information
|--------------------------------------------------------------------------
 */

'file_type_array'          => [
    'pdf'  => 'Adobe Acrobat',
    'doc'  => 'Microsoft Word',
    'docx' => 'Microsoft Word',
    'xls'  => 'Microsoft Excel',
    'xlsx' => 'Microsoft Excel',
    'zip'  => 'Archive',
    'gif'  => 'GIF Image',
    'jpg'  => 'JPEG Image',
    'jpeg' => 'JPEG Image',
    'png'  => 'PNG Image',
    'ppt'  => 'Microsoft PowerPoint',
    'pptx' => 'Microsoft PowerPoint',
],

'file_icon_array'          => [
    'pdf'  => 'fa-file-pdf-o',
    'doc'  => 'fa-file-word-o',
    'docx' => 'fa-file-word-o',
    'xls'  => 'fa-file-excel-o',
    'xlsx' => 'fa-file-excel-o',
    'zip'  => 'fa-file-archive-o',
    'gif'  => 'fa-file-image-o',
    'jpg'  => 'fa-file-image-o',
    'jpeg' => 'fa-file-image-o',
    'png'  => 'fa-file-image-o',
    'ppt'  => 'fa-file-powerpoint-o',
    'pptx' => 'fa-file-powerpoint-o',
],

/*
|--------------------------------------------------------------------------
| php.ini override
|--------------------------------------------------------------------------
|
| These values override your php.ini settings before uploading files
| Set these to false to ingnore and apply your php.ini settings
|
| Please note that the 'upload_max_filesize' & 'post_max_size'
| directives are not supported.
 */
'php_ini_overrides'        => [
    'memory_limit' => '256M',
],

];

any help please?

Please sign in or create an account to participate in this conversation.