I'm doing tests on deploy .
A few days ago I did it in the following way, I uploaded the files in my CPanel hosting to the root, that is, /home/miproyecto
and that of the public folder in /home/miproyecto/public_html
, I made the adjustment of the new public route en AppServiceProviders.php
.
$this->app->bind('path.public', function() {
return base_path('public_html');
});
Everything worked fine, even the images I upload do it correctly inside the public folder.
Today I did it in the same way, except that instead of uploading the project to /home/miproyecto
, I did it in /home/miproyecto/laravel
for more organization.
I also made adjustments to indicate the public folder and everything works fine, except now the base_path
, instead of remaining in /home/miproyecto
remains in /home/miproyecto/laravel
.
Now when uploading images instead of being saved in /home/miproyecto/public_html/img
upload to /home/miproyecto/laravel/public_html/img
In the index.php I made the adjustments so that the route of the project is recognized
require __DIR__ . '/../laravel/vendor/autoload.php';
$app = require_once __DIR__ . '/../laravel/bootstrap/app.php';