Category Archives: Laravel

Overwrite Laravel Helpers

To control http / https related URL generators, some helpers must be overwritten.

Add param in .env:

Find helper file:



Laravel redirect() issue


If ELB pass 443 port to 80 port of the web server inside, and disable 80 port on ELB, redirect() will cause problem. Because redirect() always redirect pages to http and it will not display.

Following traditional way to redirect pages will cause session problem in laravel:


Pass full URL to redirect() function instead of URI only.

How to set BASE_URL: (in app\Providers\AppServiceProvider.php)


Not to close 80 port on ELB.


Laravel Filemanager


Notes for installation:

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

To debug uploading process:


HTML Example:

Helper to get thumb:


  1. 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:


php artisan vendor:publish

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

e.g. Laravel Filemanager

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


Submit form using Jquery Form Plugin (ajaxform)

Javascript Example:

Plugin Official Site:

Laravel Swiftmailer Example