/** * Handle the command. * * @param CreateShopCommand $command * @return void */ public function handle(CreateShopCommand $command) { $shop = Shop::create(['scheduled' => $command->scheduled, 'title' => $command->title, 'amount' => $command->amount, 'reimbursement' => $command->reimbursement, 'postcode' => $command->postcode, 'description' => $command->description, 'proof' => $command->proof, 'client_id' => $command->client_id, 'key_id' => $command->key_id, 'geocoding_id' => 1]); if (!empty($shop)) { //Create Geocoding Job $job = (new UpdateShopGeocoding($shop))->delay(5); $this->dispatch($job); //Create shop calendar event // $job = (new CreateShopCalendarEvent($shop))->delay(5); // $this->dispatch($job); $this->calendar->save($shop); return $shop; } return false; }