/** * Handle the command. * * @param CreateSliderCommand $command * @return void */ public function handle(CreateSliderCommand $command) { $active = $command->active === 'on' ? 1 : 0; $slider_object = Slider::make($command->titoli, $command->sottotitoli, $command->link, $active); // dd($slider_object); $slider = $this->repo->save($slider_object); $this->caricaImmagine($slider, $command->immagine); Event::fire(new SliderWasCreated($slider)); return $slider; }
public function getById($id) { return Slider::with('translations')->where('id', $id)->first(); }