JobTitlesMainSeeder.php 1.78 KB
<?php

namespace Database\Seeders;

use App\Models\job_titles_main;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Seeder;

class JobTitlesMainSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $data = [
            /*1 */[
                'name' => 'Пункт 1',
                'job_title_id' => '0',
                'sort' => '100',

            ],
            /*2*/[
                'name' => 'Пункт 2',
                'job_title_id' => '0',
                'sort' => '110',
            ],
            /*3*/[
                'name' => 'Пункт 3',
                'job_title_id' => '0',
                'sort' => '120',
            ],
            /*4*/[
                'name' => 'Пункт 4',
                'job_title_id' => '0',
                'sort' => '130',
            ],
            /*5*/[
                'name' => 'Пункт 5',
                'job_title_id' => '0',
                'sort' => '140',
            ],
            /*6*/[
                'name' => 'Пункт 6',
                'job_title_id' => '0',
                'sort' => '150',
            ],
            /*7*/[
                'name' => 'Пункт 7',
                'job_title_id' => '0',
                'sort' => '160',
            ],
            /*8*/[
                'name' => 'Пункт 8',
                'job_title_id' => '0',
                'sort' => '170',
            ],
        ];

        foreach ($data as $item) {
            $emp = new job_titles_main();
            $emp->name = $item['name'];
            $emp->job_title_id = $item['job_title_id'];
            $emp->sort = $item['sort'];
            $emp->save();
        }
    }
}