Heimdall/app/Jobs/ProcessApps.php

47 lines
969 B
PHP
Raw Normal View History

2018-11-01 08:55:21 +00:00
<?php
namespace App\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Support\Facades\Storage;
2018-11-01 08:55:21 +00:00
use App\Application;
use App\SupportedApps;
class ProcessApps implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/**
* Create a new job instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
2022-03-16 15:49:44 +00:00
$localapps = Application::whereNull('class')->get();
$json = SupportedApps::getList()->getBody();
Storage::disk('local')->put('supportedapps.json', $json);
2022-03-16 15:49:44 +00:00
foreach($localapps as $app) {
$app->class = $app->class();
$app->save();
}
2018-11-01 08:55:21 +00:00
}
}