Daily Archives: 01/06/2019

Laravel Filemanager

Official:

https://unisharp.github.io/laravel-filemanager/installation

Notes for installation:

  1. composer require unisharp/laravel-filemanager:~1.8
    This command is must
  2. Under 5.5 need to add service providers and then execute vender:publish commands.
  3. <script src=”/vendor/laravel-filemanager/js/lfm.js”></script>
    Javascript name in DOC is wrong.
  4. Remove “auth” middleware from /config/lfm.php if don’t need auth.
  5. If don’t use auth, override function in /vendor/…/Handlers/ConfigHandler to return static number. e.g. 1
    \vendor\unisharp\laravel-filemanager\src\Handlers\ConfigHandler.php
  6. Make sure extension “mbstring” and “exif” is enabled in php.ini

To debug uploading process:

\vendor\unisharp\laravel-filemanager\src\controllers\UploadController.php

HTML Example:

Helper to get thumb:

Note:

  1. Language:
    Just change language code in configs/app.php. e.g. zh-TW
    Supported language files:
    \vendor\unisharp\laravel-filemanager\src\lang\
  2. Main view of File Manager is “\vendor\unisharp\laravel-filemanager\src\views\index.blade.php” and it uses some helpers of laravel like url(), asset(). If you use https only, these helpers will cause error. Try to overwrite Laravel helpers will solve these problems.
    Path to laravel helper:
    \vendor\laravel\framework\src\Illuminate\Foundation\helpers.php

     

php artisan vendor:publish

This command will copy config file or assets files from /vendor to /public/vendor

e.g. Laravel Filemanager

https://unisharp.github.io/laravel-filemanager/installation

After add service providers in config/app.php, following commands will copy config and assets: