<?php

use Illuminate\Database\Seeder;
use App\Toko;
use App\Menu;
use App\BeliLog;
use App\User;
class MenusSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //Sample Toko
        $toko1  = Toko::create(['name'=>'Mak Robi']);
        $toko2  = Toko::create(['name'=>'Mak Sarah']);
        $toko3  = Toko::create(['name'=>'Mak Atur']);

        //Sample  Menu
        $menu1  = Menu::create(['title'=>'Nasi Rendang','amount'=>'20','price'=>'15000','toko_id'=>$toko1->id]);
        $menu2  = Menu::create(['title'=>'Mie Babi','amount'=>'20','price'=>'10000','toko_id'=>$toko2->id]);
        $menu3  = Menu::create(['title'=>'Nasi Saksang','amount'=>'20','price'=>'13000','toko_id'=>$toko3->id]);

        //Pemesanan Makanan
        $member = User::where('email','member@gmail.com')->first();
        BeliLog::create(['user_id' => $member->id, 'menu_id'=>$menu1->id,'dibatalkan'=>0]);
        BeliLog::create(['user_id' => $member->id, 'menu_id'=>$menu2->id,'dibatalkan'=>0]);
        BeliLog::create(['user_id' => $member->id, 'menu_id'=>$menu3->id,'dibatalkan'=>0]);
    }
}
