/** * Handle the command. * * @param UpdateTdvCommand $command * @return void */ public function handle(UpdateTdvCommand $command) { $active = $command->active === 'on' ? 1 : 0; $tdv_object = Tdv::edit($command->tdv_id, $command->titolo, $active); $tdv = $this->repo->save($tdv_object); $this->caricaAllegato($tdv, $command->allegato); Event::fire(new TdvWasUpdated($tdv)); return $tdv; }
public function getById($id) { return Tdv::where('id', $id)->first(); }