The file (in this case an image) does not upload to the hosting public. Unusually something that started to happen to me today. Without reason. I did not make any changes to the controller. And localhost is perfect
Restart the hosting to 0 and return to move all folders and remains the same.
I leave the controller, where I bring a request with the file
public function store(ArticuloRequest $request)
{
$articulo = new Articulo($request->all());
$articulo->usuario_id = \Auth::user()->id;
$articulo->save();
$articulo->tags()->sync($request->tags);
if($request->file('imagen'))
{
//Manipulacion de imagenes
$file= $request->file('imagen');
$nombre= 'emap_'.time().'.'.$file->getClientOriginalExtension();
$path = public_path().'/img/articulos';
$file->move($path,$nombre);
$img = new Imagen();
$img->nombre = $nombre;
$img->articulo()->associate($articulo);
$img->save();
dd($path);
}
flash("Se ha creado el articulo ".$articulo->titulo." de forma exitosa!", 'success')->important();
return redirect()->route('articulos.index');
}
the dd ($ path) returns me
"/home/u923520231/public/img/articulos"
The data base is u923520231_emap. I am using a shared hosting (hostinger)