Added admin seeder and Updated User seeder
This commit is contained in:
17
database/seeders/AdminSeeder.php
Normal file
17
database/seeders/AdminSeeder.php
Normal 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
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,7 +21,7 @@ class UserSeeder extends Seeder
|
|||||||
// Data to update/create
|
// Data to update/create
|
||||||
[
|
[
|
||||||
'name' => 'Admin',
|
'name' => 'Admin',
|
||||||
'password' => Hash::make('admin'),
|
'password' => Hash::make('jOtHi$9000'),
|
||||||
'updated_at' => now(),
|
'updated_at' => now(),
|
||||||
'created_at' => now()
|
'created_at' => now()
|
||||||
]
|
]
|
||||||
@@ -35,79 +35,60 @@ class UserSeeder extends Seeder
|
|||||||
|
|
||||||
$user2 = User::updateOrCreate(
|
$user2 = User::updateOrCreate(
|
||||||
// Unique identifier
|
// Unique identifier
|
||||||
['email' => 'jothi@cripumps.com'],
|
['email' => 'dhanabalan@cripumps.com'],
|
||||||
|
|
||||||
// Data to update/create
|
// Data to update/create
|
||||||
[
|
[
|
||||||
'name' => 'Jothi',
|
'name' => 'Dhanabalan S',
|
||||||
'password' => bcrypt('jothi@123'),
|
'password' => bcrypt('SdHaNa@123'),
|
||||||
'updated_at' => now(),
|
'updated_at' => now(),
|
||||||
'created_at' => now()
|
'created_at' => now()
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
// $user2 = User::firstOrCreate([
|
// $user2 = User::firstOrCreate([
|
||||||
// 'name' => 'Jothi',
|
// 'name' => 'Dhana',
|
||||||
// 'email' => 'jothi@cripumps.com',
|
// 'email' => 'dhana@cripumps.com',
|
||||||
// 'password' => bcrypt('jothi@123'),
|
// 'password' => bcrypt('dhana@123'),
|
||||||
// ]);
|
// ]);
|
||||||
$user2->assignRole('Super Admin');
|
$user2->assignRole('Super Admin');
|
||||||
|
|
||||||
$user3 = User::updateOrCreate(
|
$user3 = User::updateOrCreate(
|
||||||
// Unique identifier
|
// Unique identifier
|
||||||
['email' => 'dhana@cripumps.com'],
|
['email' => 'ranjith@cripumps.com'],
|
||||||
|
|
||||||
// Data to update/create
|
// Data to update/create
|
||||||
[
|
[
|
||||||
'name' => 'Dhana',
|
'name' => 'Ranjith B',
|
||||||
'password' => bcrypt('dhana@123'),
|
'password' => bcrypt('Ranjii@5503'),
|
||||||
'updated_at' => now(),
|
'updated_at' => now(),
|
||||||
'created_at' => now()
|
'created_at' => now()
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
// $user3 = User::firstOrCreate([
|
// $user3 = User::firstOrCreate([
|
||||||
// 'name' => 'Dhana',
|
// 'name' => 'Ranjith',
|
||||||
// 'email' => 'dhana@cripumps.com',
|
// 'email' => 'ranjith@cripumps.com',
|
||||||
// 'password' => bcrypt('dhana@123'),
|
// 'password' => bcrypt('ranjith@123'),
|
||||||
// ]);
|
// ]);
|
||||||
$user3->assignRole('Super Admin');
|
$user3->assignRole('Super Admin');
|
||||||
|
|
||||||
$user4 = User::updateOrCreate(
|
$user4 = User::updateOrCreate(
|
||||||
// Unique identifier
|
// Unique identifier
|
||||||
['email' => 'ranjith@cripumps.com'],
|
['email' => 'srimathi@cripumps.com'],
|
||||||
|
|
||||||
// Data to update/create
|
// Data to update/create
|
||||||
[
|
[
|
||||||
'name' => 'Ranjith',
|
'name' => 'Srimathi M',
|
||||||
'password' => bcrypt('ranjith@123'),
|
'password' => bcrypt('MsRi@123'),
|
||||||
'updated_at' => now(),
|
'updated_at' => now(),
|
||||||
'created_at' => now()
|
'created_at' => now()
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
// $user4 = User::firstOrCreate([
|
// $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',
|
// 'name' => 'Srimathi',
|
||||||
// 'email' => 'srimathi@cripumps.com',
|
// 'email' => 'srimathi@cripumps.com',
|
||||||
// 'password' => bcrypt('srimathi@123'),
|
// 'password' => bcrypt('srimathi@123'),
|
||||||
// ]);
|
// ]);
|
||||||
$user5->assignRole('Super Admin');
|
$user4->assignRole('Super Admin');
|
||||||
// User::factory()->count(5)->create();
|
// User::factory()->count(5)->create();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user