devsemicolon / filemanager
There is no license information available for the latest version (1.0.0) of this package.
A File Manager Package for Laravel
1.0.0
2023-03-09 05:42 UTC
This package is auto-updated.
Last update: 2025-07-17 10:57:02 UTC
README
Laravel File Manager for v5.8.
Installation
- Install package - using composer
composer require devsemicolon/filemanager
- Publish the provider
php artisan vendor:publish --tag=filemanager
Usage
-
Add site's non public url to .env's
APP_URL
-
Add these scripts to footer of the page you want to set filemanager to, or set it on global footer
<script src="{{ asset('js/jquery-2.1.1.min.js') }}"></script>
<script src="{{ asset('js/filemanager.js') }}"></script>
- Add these to
<head>
tag
<meta name="csrf-token" content="{{ csrf_token() }}">
<link href="{{ asset('css/filemanager.css') }}" rel="stylesheet">
<link href="{{ asset('css/font-awesome/css/font-awesome.css') }}" rel="stylesheet">
Note: No need to add csrf-token,app.js and app.css if you are already added.
- Add following code to blade file enable file manager
<div class="image-manager-main-div">
<div style="display: none;" class="image-manager-image-div"><img src="" alt="" title=""/></div>
<button type="button" class="image-manager-button">Set image</button>
<input type="hidden" class="thumb-placement" name="image" id="thumb-placement" />
</div>
Note : if you want to use multiple thumbnails on single page then make sure to make id="thumb-placement" unique and take name="image" as an array name="image[]"
Change config
All the default config are set in config/imagemanager.php
- Change default folder to load in imagemanager, update imagemanager_path variable. Path should be from root folder
'imagemanager_path' => 'storage/app/public',
- Change supported image types, update allowed_file_extension and allowed_file_mime_types variables.
'allowed_file_extension' => ['jpg','jpeg','gif','png','webp'],
'allowed_file_mime_types' => ['image/jpeg','image/pjpeg','image/png','image/x-png','image/gif','image/webp'],
- Change Imagemanager list thumbnail width and height, update thumbnail_height and thumbnail_weight variables.
'thumbnail_height' => '100',
'thumbnail_width' => '100',
Credit
- @opencart We are inspired by Opencart's Filemanager and have used the code to develop this package.
- @savanihd Got inspired by Hardik's code (https://www.itsolutionstuff.com/post/how-to-implement-infinite-ajax-scroll-pagination-in-laravel-5example.html) for lazyloading in image manager