Neuaufbau des Repositories
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class AdminUserSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// Create an admin user if it doesn't exist
|
||||
$user = User::firstOrCreate(
|
||||
['email' => 'admin@bratanbonus.test'],
|
||||
[
|
||||
'name' => 'Admin Bratan',
|
||||
'password' => Hash::make('password'),
|
||||
'role' => 'admin',
|
||||
]
|
||||
);
|
||||
|
||||
$this->command->info('Admin User created successfully!');
|
||||
$this->command->info('--------------------------------');
|
||||
$this->command->info('Email: ' . $user->email);
|
||||
$this->command->info('Password: password');
|
||||
$this->command->info('Role: ' . $user->role);
|
||||
$this->command->info('--------------------------------');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user