/**
  * Handle the command.
  *
  * @param  UpdateStaffCommand  $command
  * @return void
  */
 public function handle(UpdateStaffCommand $command)
 {
     $staff_object = Staff::edit($command->staff_id, $command->name, $command->intro, $command->description, $command->featured_image_id, $command->website, $command->type_id);
     $staff = $this->repo->save($staff_object);
     Event::fire(new StaffWasUpdated($staff));
     return $staff;
 }
 /**
  * Handle the command.
  *
  * @param  CreateStaffCommand  $command
  * @return void
  */
 public function handle(CreateStaffCommand $command)
 {
     $staff_object = Staff::make($command->name, $command->intro, $command->description, $command->website, $command->type_id);
     $staff = $this->repo->save($staff_object);
     Event::fire(new StaffWasCreated($staff));
     return $staff;
 }
Example #3
0
 public function getById($id)
 {
     return Staff::with('media', 'featuredImage')->whereId($id)->first();
 }