/**
  * Handle the command.
  *
  * @param  UpdateNewsCommand  $command
  * @return void
  */
 public function handle(UpdateNewsCommand $command)
 {
     $active = $command->active === 'on' ? 1 : 0;
     $news_object = News::edit($command->news_id, $command->titolo, $command->descrizione, $command->testo, $active, $command->created_at);
     $news = $this->repo->save($news_object);
     $this->caricaImmagine($news, $command->immagine_path);
     Event::fire(new NewsWasUpdated($news));
     return $news;
 }
Example #2
0
 public function getById($id)
 {
     return News::where('id', $id)->first();
 }