Init commit
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class UserSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// Create sample users
|
||||
$users = [
|
||||
[
|
||||
'name' => 'John Doe',
|
||||
'email' => 'john@example.com',
|
||||
'password' => Hash::make('password123'),
|
||||
'email_verified_at' => now(),
|
||||
],
|
||||
[
|
||||
'name' => 'Jane Smith',
|
||||
'email' => 'jane@example.com',
|
||||
'password' => Hash::make('password123'),
|
||||
'email_verified_at' => now(),
|
||||
],
|
||||
[
|
||||
'name' => 'Bob Johnson',
|
||||
'email' => 'bob@example.com',
|
||||
'password' => Hash::make('password123'),
|
||||
'email_verified_at' => now(),
|
||||
],
|
||||
[
|
||||
'name' => 'Alice Brown',
|
||||
'email' => 'alice@example.com',
|
||||
'password' => Hash::make('password123'),
|
||||
'email_verified_at' => now(),
|
||||
],
|
||||
[
|
||||
'name' => 'Charlie Wilson',
|
||||
'email' => 'charlie@example.com',
|
||||
'password' => Hash::make('password123'),
|
||||
'email_verified_at' => now(),
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($users as $userData) {
|
||||
User::create($userData);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user