I deployed a Laravel 5 project to a shared hosting account, placing the app-files outside of the www-folder, placing only the public folder inside of the www-folder. All like explained here, in the best answer: Laravel 4 and the way to deploy app using FTP... without 3. because this file doesn't exist in Laravel 5.
Now when I call public_path() inside of a controller i get something like my-appfiles-outside-of-www/public instead of www/public. Does anyone know why I doesn't get the right path here? Can I change this somewhere? Thanks!
You can override public_path using container. Example:
App::bind('path.public', function() {
return base_path().'/public_html';
});
$app->bind('path.public', function() {
return __DIR__;
});
write above code in public_html\index.php above of this code
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With