<?php

namespace Database\Seeders;

use Exception;
use Illuminate\Database\Seeder;
use App\Models\Admin\AppSettings;
use App\Models\Admin\BasicSettings;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;

class UpdateFeatureSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        if (BasicSettings::first()) {
            BasicSettings::first()->update([
                'web_version'       => "1.5.0",
                 'storage_config'    => [
                    'method' => 'public',
                ],
            ]);
        }
        config(['filesystems.default' => 'public']);
        modifyEnv([
            "FILESYSTEM_DISK" => "public"
        ]);
        if (AppSettings::first()) {
            AppSettings::first()->update(['version' => '1.5.0']);
        }

        //update language values
        try{
            update_project_localization_data();
        }catch(Exception $e) {}
    }

}
