/** * Handle the command. * * @param CreateFasciaCommand $command * @return void */ public function handle(CreateFasciaCommand $command) { $fascia_object = Fascie::make($command->nome); $fascia = $this->repo->save($fascia_object); Event::fire(new FasciaWasCreated($fascia)); return $fascia; }
/** * Handle the command. * * @param UpdateFasciaCommand $command * @return void */ public function handle(UpdateFasciaCommand $command) { $fascia_object = Fascie::edit($command->fascia_id, $command->nome); $fascia = $this->repo->save($fascia_object); Event::fire(new FasciaWasUpdated($fascia)); return $fascia; }
public function getById($id) { return Fascie::where('id', $id)->with('prodotti')->first(); }