How to install and run Laravel 5.7 in subfolder and sub domain with fix asset path issue

How to install and run Laravel 5.7 in subfolder and sub domain with fix asset path issue



How to install and run Laravel 5.7 in subfolder, shared hosting and sub domain with fix asset path issue 2018-19

run laravel in sub folder, fix asset path issue while uploading in live server, run laravel shared hosting, run laravel 5.7 in sub domain,

Copy .htaccess file from public folder to root subfolder.
On the root subfolder rename server.php file to index.php
3rd step
Find
your project folder/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php

online line number 132 change

change asset($path, $secure);

with asset(“public/”.,$path, $secure);

5 thoughts on “How to install and run Laravel 5.7 in subfolder and sub domain with fix asset path issue

  1. This is horrible! You should never modify the "vendor" folder. What happens when you'll re-run the "composer install" command!?

  2. This solution worked perfectly.

    I struggled for two hours trying to figure this out. I followed your steps in three minutes and it worked!

    I would add … be sure to add security to disallow access to normal non-public and hidden Laravel files. This can be done using .htaccess.

    I can't believe hours of googling "Laravel subfolder" turning up half-solutions. But one search on YouTube for the same phase brought up the solution.

Leave a Reply

Your email address will not be published. Required fields are marked *