function findByOlxId($olxId)
 {
     if ($offer = Offer::where('olx_id', $olxId)->first()) {
         return view('offer')->with(['offer' => $offer, 'locations' => Location::all()]);
     } else {
         abort(404);
     }
 }
示例#2
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $offer = Offer::where(['olx_id' => $this->argument('id')])->first();
     if (!$offer) {
         $this->error('Offer not found: ' . $this->argument('id'));
         return;
     }
     $job = (new ExportOffer($offer))->onQueue('export_offers');
     $this->dispatch($job);
     $this->info('Export job created');
 }