Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Last active June 20, 2019 18:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/cfbbf6edfe42f25a205b8a4e5d4efb94 to your computer and use it in GitHub Desktop.
Save parzibyte/cfbbf6edfe42f25a205b8a4e5d4efb94 to your computer and use it in GitHub Desktop.
<?php
namespace App\Http\Controllers;
use App\Http\Requests\SubirFotosDeArticulosRequest;
class ArticulosController extends Controller
{
private $nombreCarpetaFotos = "fotos";
public function agregarFotos(SubirFotosDeArticulosRequest $peticion)
{
foreach ($peticion->file("fotos") as $foto) {
$fotoDeArticulo = new FotoDeArticulo;
$rutaLarga = $foto->store($this->nombreCarpetaFotos);
}
return back()
->with("mensaje", "Foto(s) agregada(s) con éxito")
->with("tipo", "success");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment