Пример #1
0
 /**
  * Handle the command.
  *
  * @param  CreateGalleryCommand  $command
  * @return void
  */
 public function handle(CreateGalleryCommand $command)
 {
     $gallery_object = Gallery::make();
     $gallery = $this->repo->save($gallery_object);
     Event::fire(new GalleryWasCreated($gallery));
     return $gallery;
 }
Пример #2
0
 /**
  * Handle the command.
  *
  * @param  UpdateGalleryCommand  $command
  * @return void
  */
 public function handle(UpdateGalleryCommand $command)
 {
     $gallery_object = Gallery::edit($command->gallery_id, $command->featured_image_id, $command->cover_image_id);
     $gallery = $this->repo->save($gallery_object);
     Event::fire(new GalleryWasUpdated($gallery));
     return $gallery;
 }
Пример #3
0
 public function getBySlug($slug)
 {
     return Gallery::where('slug', $slug)->first();
 }