/** * Handle the command. * * @param UpdatePaeseCommand $command * @return void */ public function handle(UpdatePaeseCommand $command) { $paese_object = Paesi::edit($command->paese_id, $command->nome); $paese = $this->repo->save($paese_object); Event::fire(new PaeseWasUpdated($paese)); return $paese; }
/** * Handle the command. * * @param CreatePaeseCommand $command * @return void */ public function handle(CreatePaeseCommand $command) { $paese_object = Paesi::make($command->nome); $paese = $this->repo->save($paese_object); Event::fire(new PaeseWasCreated($paese)); return $paese; }
public function getById($id) { return Paesi::where('id', $id)->with('prodotti')->first(); }