added gold price 7

A1Gard 5 months ago
parent 7e624851d0
commit bfaf22c535

@ -31,14 +31,11 @@ class GoldPriceUpdate extends Command
public function handle()
{
//
echo 'start';
$client = new Client();
$response = $client->request('GET', $this->api);
$data = json_decode($response->getBody()->getContents());
print_r($data);
// print_r($data);
if (isset($data->gold)) {
$s = Setting::where('key', 'gold')->first();
$s->value = $data->gold;
$s->save();

@ -2,6 +2,7 @@
namespace App\Providers;
use App\Console\Commands\AssetsBuild;
use App\Console\Commands\GoldPriceUpdate;
use App\Helpers\TDate;
use App\Http\Middleware\Acl;
use App\Models\Area;
@ -24,6 +25,7 @@ class AppServiceProvider extends ServiceProvider
$this->commands([
TranslatorCommand::class,
AssetsBuild::class,
GoldPriceUpdate::class,
]);
foreach (config('xshop.payment.gateways') as $gateway){
/** @var \App\Contracts\Payment $gateway */

@ -2,10 +2,10 @@
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;
use \Illuminate\Support\Facades\Schedule;
Artisan::command('inspire', function () {
$this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote')->hourly();
Artisan::command('gold', function () {})->everyFiveMinutes();
Schedule::command('gold')->everyFiveMinutes();

Loading…
Cancel
Save