1
0
forked from poc/pds

Added admin seeder and Updated User seeder

This commit is contained in:
dhanabalan
2025-04-28 00:35:28 +05:30
parent 0971c25a5c
commit 09acb4453c
2 changed files with 34 additions and 36 deletions

View File

@@ -0,0 +1,17 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class AdminSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
//
}
}

View File

@@ -21,7 +21,7 @@ class UserSeeder extends Seeder
// Data to update/create
[
'name' => 'Admin',
'password' => Hash::make('admin'),
'password' => Hash::make('jOtHi$9000'),
'updated_at' => now(),
'created_at' => now()
]
@@ -35,79 +35,60 @@ class UserSeeder extends Seeder
$user2 = User::updateOrCreate(
// Unique identifier
['email' => 'jothi@cripumps.com'],
['email' => 'dhanabalan@cripumps.com'],
// Data to update/create
[
'name' => 'Jothi',
'password' => bcrypt('jothi@123'),
'name' => 'Dhanabalan S',
'password' => bcrypt('SdHaNa@123'),
'updated_at' => now(),
'created_at' => now()
]
);
// $user2 = User::firstOrCreate([
// 'name' => 'Jothi',
// 'email' => 'jothi@cripumps.com',
// 'password' => bcrypt('jothi@123'),
// 'name' => 'Dhana',
// 'email' => 'dhana@cripumps.com',
// 'password' => bcrypt('dhana@123'),
// ]);
$user2->assignRole('Super Admin');
$user3 = User::updateOrCreate(
// Unique identifier
['email' => 'dhana@cripumps.com'],
['email' => 'ranjith@cripumps.com'],
// Data to update/create
[
'name' => 'Dhana',
'password' => bcrypt('dhana@123'),
'name' => 'Ranjith B',
'password' => bcrypt('Ranjii@5503'),
'updated_at' => now(),
'created_at' => now()
]
);
// $user3 = User::firstOrCreate([
// 'name' => 'Dhana',
// 'email' => 'dhana@cripumps.com',
// 'password' => bcrypt('dhana@123'),
// 'name' => 'Ranjith',
// 'email' => 'ranjith@cripumps.com',
// 'password' => bcrypt('ranjith@123'),
// ]);
$user3->assignRole('Super Admin');
$user4 = User::updateOrCreate(
// Unique identifier
['email' => 'ranjith@cripumps.com'],
['email' => 'srimathi@cripumps.com'],
// Data to update/create
[
'name' => 'Ranjith',
'password' => bcrypt('ranjith@123'),
'name' => 'Srimathi M',
'password' => bcrypt('MsRi@123'),
'updated_at' => now(),
'created_at' => now()
]
);
// $user4 = User::firstOrCreate([
// 'name' => 'Ranjith',
// 'email' => 'ranjith@cripumps.com',
// 'password' => bcrypt('ranjith@123'),
// ]);
$user4->assignRole('Super Admin');
$user5 = User::updateOrCreate(
// Unique identifier
['email' => 'srimathi@cripumps.com'],
// Data to update/create
[
'name' => 'Srimathi',
'password' => bcrypt('srimathi@123'),
'updated_at' => now(),
'created_at' => now()
]
);
// $user5 = User::firstOrCreate([
// 'name' => 'Srimathi',
// 'email' => 'srimathi@cripumps.com',
// 'password' => bcrypt('srimathi@123'),
// ]);
$user5->assignRole('Super Admin');
$user4->assignRole('Super Admin');
// User::factory()->count(5)->create();
}
}