/**
  * Handle the command.
  *
  * @param  UpdateNewsCommand  $command
  * @return void
  */
 public function handle(UpdateNewsCommand $command)
 {
     $news_object = News::edit($command->news_id, $command->title, str_slug($command->title), $command->excerpt, $command->body, $command->featured_image_id);
     $news = $this->repo->save($news_object);
     Event::fire(new NewsWasUpdated($news));
     return $news;
 }
 /**
  * Handle the command.
  *
  * @param  CreateNewsCommand  $command
  * @return void
  */
 public function handle(CreateNewsCommand $command)
 {
     $news_object = News::make();
     $news = $this->repo->save($news_object);
     Event::fire(new NewsWasCreated($news));
     return $news;
 }
예제 #3
0
 public function remove($id)
 {
     $activity = News::find($id);
     $activity->delete();
     return true;
 }