70d4767890
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
39 lines
879 B
PHP
39 lines
879 B
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\Role;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
use Illuminate\Database\Seeder;
|
|
use Illuminate\Support\Facades\Hash;
|
|
|
|
class DatabaseSeeder extends Seeder
|
|
{
|
|
use WithoutModelEvents;
|
|
|
|
/**
|
|
* Seed the application's database.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
// User::factory(10)->create();
|
|
$this->call([
|
|
RoleSeeder::class,
|
|
StressEventSeeder::class,
|
|
RelaxationActivitySeeder::class,
|
|
]);
|
|
|
|
$adminRole = Role::where('libelle', 'Admin')->first();
|
|
|
|
User::firstOrCreate(
|
|
['email' => 'admin@cesizen.fr'],
|
|
[
|
|
'name' => 'AdminCESI',
|
|
'password' => Hash::make('okokokok'),
|
|
'id_role' => $adminRole->id,
|
|
]
|
|
);
|
|
}
|
|
}
|