/**
  * Handle the command.
  *
  * @param  CreatePosizioneApertaCommand  $command
  * @return void
  */
 public function handle(CreatePosizioneApertaCommand $command)
 {
     $active = $command->active === 'on' ? 1 : 0;
     $posizione_object = PosizioniAperte::make($command->titolo, $command->sede, $command->descrizione, $active);
     $posizione = $this->repo->save($posizione_object);
     Event::fire(new PosizioneApertaWasCreated($posizione));
     return $posizione;
 }
Пример #2
0
 public function getBySlug($slug)
 {
     return PosizioniAperte::where('slug', $slug)->first();
 }