<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     *
     * @return void
     */
    public function run()
    {
        // buat superadmin
        $superadmin = new \App\Models\User();
        $superadmin->email = 'superadmin@gmail.com';
        $superadmin->username = 'superadmin';
        $superadmin->password = bcrypt('superadmin');
        $superadmin->role = 'superadmin';
        $superadmin->save();

        // buat admin
        $admin = new \App\Models\User();
        $admin->username = 'admin-01';
        $admin->email = 'admin-01@gmail.com';
        $admin->password = bcrypt('admin-01');
        $admin->role = 'admin';
        $admin->save();

        // buat brand
        $brand = new \App\Models\Brand();
        $brand->nama_brand = 'Laundry Bersih';
        $brand->users_id = $admin->id;
        $brand->logo_brand = 'logo.png';
        $brand->status = 'aktif';
        $brand->alamat = 'Jl. Mawar No. 10 Cimanggis Depok';
        $brand->no_telp = '081234567890';
        $brand->email = 'laundry-bersih@gmail.com';
        $brand->moto = 'Cuci Bersih Sekarang Cukup Mudah dan Cepat';
        $brand->created_at = date('Y-m-d H:i:s');
        $brand->save();

        // buat admin
        $admin = new \App\Models\Admin();
        $admin->users_id = 2;
        $admin->brand_id = $brand->id;
        $admin->nama = 'Shella Admin-02';
        $admin->alamat = 'Situbondo Jawa Timur';
        $admin->foto = '1.jpg';
        $admin->save();

        // buat laundry
        $laundry = new \App\Models\Laundry();
        $laundry->brand_id = $brand->id;
        $laundry->nama_laundry = 'Laundry Bersih 1';
        $laundry->alamat = 'Jl. Mawar No. 10 Cimanggis Depok';
        $laundry->no_telp = '081234567890';
        $laundry->email = 'laundry1-bersih1@gmail.com';
        $laundry->status = 'trial';
        $laundry->tgl_daftar = date('Y-m-d');
        $laundry->created_at = date('Y-m-d H:i:s');
        $laundry->save();
    }
}
