mirror of
https://github.com/sp-tarkov/forge.git
synced 2025-02-13 04:30:41 -05:00
This update gives mod versions a supported SPT version field that accepts a semantic version. The latest supported SPT version will be automatically resolved based on the semvar. Next up: I need to update the ModVersion to SptVersion relationship to be a many-to-many and expand the resolution to resolve multiple versions.
30 lines
804 B
PHP
30 lines
804 B
PHP
<?php
|
|
|
|
namespace App\Jobs;
|
|
|
|
use App\Models\ModVersion;
|
|
use App\Services\DependencyVersionService;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldBeUnique;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class ResolveDependenciesJob implements ShouldBeUnique, ShouldQueue
|
|
{
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
/**
|
|
* Resolve the SPT versions for each of the mod versions.
|
|
*/
|
|
public function handle(): void
|
|
{
|
|
$dependencyVersionService = new DependencyVersionService;
|
|
|
|
foreach (ModVersion::all() as $modVersion) {
|
|
$dependencyVersionService->resolve($modVersion);
|
|
}
|
|
}
|
|
}
|