HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-10-0-8-47 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:31:58 UTC 2024 aarch64
User: ubuntu (1000)
PHP: 8.1.2-1ubuntu2.22
Disabled: NONE
Upload Files
File: /var/www/admin.javaapp.co.uk/database/seeders/AppVersionSeeder.php
<?php

namespace Database\Seeders;

use App\Models\AppVersion;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Database\Seeders\Traits\DisableForeignKeys;
use Database\Seeders\Traits\TruncateTable;
use Illuminate\Support\Carbon;

class AppVersionSeeder extends Seeder
{
    use DisableForeignKeys, TruncateTable;

    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        // $this->disableForeignKeys();
        // AppVersion::truncate();

        $appVersions = [
            [
                'force_update_status' => '0',
                'os_type' => 1,
                'version' => '1.0',
                'normal_update_message' => 'There is a new version available on Play Store. Would you like to download it?',
                'force_update_message' => 'There is a new version available on Play Store. Press Update to download it.',
                'created_at' => Carbon::now()->timestamp,
                'updated_at' => Carbon::now()->timestamp,
            ],
            [
                'force_update_status' => '0',
                'os_type' => 2,
                'version' => '1.0',
                'normal_update_message' => 'There is a new version available on App Store. Would you like to download it?',
                'force_update_message' => 'There is a new version available on App Store. Press Update to download it.',
                'created_at' => Carbon::now()->timestamp,
                'updated_at' => Carbon::now()->timestamp,
            ],
        ];
        AppVersion::insert($appVersions);
    }
}