<?php
namespace App\Services\Generators;
use Illuminate\Support\Facades\Storage;
use App\Models\Quote;

class ForeflightGenerator {
	public static function generate(Quote $quote, bool $force = false): array {
		$path = "quotes/{$quote->id}/kml.kml";
		if(!$force && Storage::exists($path)) return [0, Storage::get($path)];
		$x = view('mail.foreflight', ['quote' => $quote])->render();
		Storage::put($path, $x);
		return [1, $x];
		}
	}
