/
home
/
old_henza
/
server
/
app
/
Console
/
Commands
/
File Upload :
llllll
Current File: //home/old_henza/server/app/Console/Commands/GetGoldPriceForPwa.php
<?php namespace App\Console\Commands; use App\Models\ConfigStatic; use Illuminate\Console\Command; use Illuminate\Support\Arr; use Illuminate\Support\Facades\Http; use Morilog\Jalali\Jalalian; class GetGoldPriceForPwa extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'pwa:price'; /** * The console command description. * * @var string */ protected $description = 'Command description'; /** * Create a new command instance. * * @return void */ public function __construct() { parent::__construct(); } /** * Execute the console command. * * @return int */ public function handle() { $service = Http::get('https://api.ratebox.ir/apijson.php?token='.env('WEBSERVICE_TOKEN')) ->json(); if (!is_null($service)){ $service['uaj'] = Jalalian::forge(now())->format('Y/m/d - H:i:s'); $filtered =Arr::except($service, [7,8,9,10,20,21,22,23,24,25,26,27,28,29]); ConfigStatic::where('key','gold_price_pwa')->update(['val' => $filtered]); } } }
Copyright ©2k19 -
Hexid
|
Tex7ure