<?php

use App\Models\Setting;
use Illuminate\Database\Migrations\Migration;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Setting::firstOrCreate(
            ['key' => 'show_print_bio_qr_code'],
            [
                'value' => '0',
                'type' => 'boolean',
                'group' => 'frontend',
                'description' => 'Show a QR code linking to the pet\'s public page on the printable bio/PDF document',
            ]
        );
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Setting::where('key', 'show_print_bio_qr_code')->delete();

        Setting::clearCache();
    }
};
