Deploy Laravel 5 using only FTP in a shared hosting Deploy Laravel 5 using only FTP in a shared hosting laravel laravel

Deploy Laravel 5 using only FTP in a shared hosting


  1. I create a new folder named "protected"
  2. Move all except "public" folder into "protected" folder
  3. Move all inside "public" folder to root
  4. Edit index.php in root folder(from public folder),

edit require __DIR__.'/../bootstrap/autoload.php'; into require __DIR__.'/protected/bootstrap/autoload.php';

also edit $app = require_once __DIR__.'/../bootstrap/app.php';into $app = require_once __DIR__.'/protected/bootstrap/app.php';


UPDATE
This is a risky process. By using this, you give malicious users permissions to find bugs. like, http://project-url/storage/logs/laravel.log is still open.


Previous Answer:
Those who hardly check the comments, @Andrew F. has already given the answer.
but he missed some other files like composer and package.
Formatted answer is:

  1. move every file in public to parent folder.
  2. update paths in index.php.
  3. add the following line to .htaccess:
    RewriteRule ^(server\.php|gulpfile\.js|\.env|composer.*|package.*) - [F,L,NC]


There is no difference between L4 and L5, so do the same thing you did for L4.