Thanks to hiring a hosting that does not let me access beyond public_html. I have to put the whole project there, using public_html as root. Then separate in a folder called laravel, the whole project and leave loose inside public_html everything that belonged to public
Changing the index a bit like this
require __DIR__.'/laravel/bootstrap/autoload.php';
$app = require_once __DIR__.'/laravel/bootstrap/app.php';
It started to work, it had a privilege problem, that's why at first the photos were not seen, the issue is that when uploading an image from my site, I created the public/img inside Laravel and it uploads the image correctly, but it hosts it there and not in the img inside public_html
A code snippet of how I display an image
if($request->file('imagen'))
{
//Manipulacion de imagenes
$file= $request->file('imagen');
$nombre= 'emap_'.$evento->nombre.'-'.$fecha->toDateString().'.'.$file->getClientOriginalExtension();
$path = public_path().'/img/eventos';
$file->move($path,$nombre);
$evento->imagen = $nombre;
}
I have to get it to host correctly from my root, which in my case is public_html/img/...
modifying the public_path() in app/Providers/AppServiceProvider in such a way that the public goes down one level to the public_html would be the solution
public function register()
{
$this->app->bind('path.public', function() {
return base_path().'/public_html'; // como moficar esta linea para que me imprima correctamente
});
}
I leave my site to make it easier to verify the problem: emap.com.ar
Try to add this piece of code that you should change in the index.php file
Source: https://laracasts.com/discuss/channels/general-discussion/where-do-you-set-public-directory-laravel-5