adds roles
This commit is contained in:
@@ -1,22 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Role;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class JonathanSeeder extends Seeder
|
||||
final class JonathanSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
* Seed the application's database with admin user Jonathan.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$adminRole = Role::where('name', 'admin')->first();
|
||||
|
||||
User::factory()->create([
|
||||
'name' => 'Jonathan',
|
||||
'email' => 'jonathan@blijnder.nl',
|
||||
'password' => bcrypt('secret'),
|
||||
'email_verified_at' => now(),
|
||||
'role_id' => $adminRole->id,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user