/**
  * Handle the command.
  *
  * @param  CreateActivityCommand  $command
  * @return void
  */
 public function handle(CreateActivityCommand $command)
 {
     $activity_object = Activities::make($command->title, str_slug($command->title, '-'), $command->subtitle, $command->description, strtoupper($command->featured));
     $activity = $this->repo->save($activity_object);
     Event::fire(new ActivityWasCreated($activity));
     return $activity;
 }
 /**
  * Handle the command.
  *
  * @param  UpdateActivityCommand  $command
  * @return void
  */
 public function handle(UpdateActivityCommand $command)
 {
     $activity_object = Activities::edit($command->activity_id, $command->title, str_slug($command->title, '-'), $command->subtitle, $command->description, strtoupper($command->featured), $command->status_id, $command->featured_image_id);
     $activity = $this->repo->save($activity_object);
     Event::fire(new ActivityWasUpdated($activity));
     return $activity;
 }
Example #3
0
 public function getById($id)
 {
     return Activities::with('media', 'status', 'featuredImage')->whereId($id)->first();
 }