<?php

namespace Database\Seeders;

use App\Models\User;
use Illuminate\Database\Seeder;

class SupplierTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        
        $suppliers = [
            [
                'name' => 'supplier name 1',
                'photo' => 'http://127.0.0.1:8000/storage/1/profile.png',
            ],
            [
                'name' => 'supplier name 2',
                'photo' => 'http://127.0.0.1:8000/storage/1/profile.png',
            ],
            [
                'name' => 'supplier name 3',
                'photo' => 'http://127.0.0.1:8000/storage/1/profile.png',
            ],
            [
                'name' => 'supplier name 4',
                'photo' => 'http://127.0.0.1:8000/storage/1/profile.png',
            ],
        ];

        foreach ($suppliers as $supplier) {
            
            $cust = User::create([
                'name'  => $supplier['name'],
                'photo' => $supplier['photo'],
            ]);

            $cust->assignRole('supplier');
        }

    }
}
