Skip to content

Commit

Permalink
user seeder
Browse files Browse the repository at this point in the history
  • Loading branch information
AndikaHilmiHamdani committed Mar 18, 2022
1 parent bcd07df commit 50296d5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 26 deletions.
24 changes: 0 additions & 24 deletions database/seeders/ModelhasRoleSeeder.php

This file was deleted.

22 changes: 20 additions & 2 deletions database/seeders/UserSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Database\Seeders;

use App\Models\User;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
Expand All @@ -16,12 +17,29 @@ class UserSeeder extends Seeder
*/
public function run()
{
DB::table('users')->insert([
'nama_karyawan'=>'Kasir2',
$kasir= User::create([
'nama_karyawan'=>'kasir 1',
'email'=>'kasir1@rejiku.com',
'alamat'=> 'jalanin aja dulu',
'no_hp'=>'12344',
'password'=>Hash::make('12345678'),
]);
$kasir ->assignRole('kasir');
$manajer= User::create([
'nama_karyawan'=>'Manajer',
'alamat'=> 'jalanin doang ga jadian',
'no_hp'=>'12344',
'email'=>'manajer2@rejiku.com',
'password'=>bcrypt('12345678')
]);
$manajer ->assignRole('manajer');
$kasir= User::create([
'nama_karyawan'=>'Kasir 2',
'alamat'=> 'jalan yok',
'no_hp'=>'12344',
'email'=>'kasir2@rejiku.com',
'password'=>bcrypt('12345678')
]);
$kasir ->assignRole('kasir');
}
}

0 comments on commit 50296d5

Please sign in to comment.