2025-11-05 17:09:12 +03:00

135 lines
4.5 KiB
PHP

<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use App\Models\Employee;
class EmployeeSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
// Create employees with different roles (matching actual table columns)
$employees = [
[
'first_name' => 'Jean',
'last_name' => 'Dupont',
'email' => 'jean.dupont@thanasoft.com',
'phone' => '+261341234567',
'job_title' => 'Développeur Full-Stack',
'hire_date' => '2022-01-15',
'active' => true,
],
[
'first_name' => 'Marie',
'last_name' => 'Rasoa',
'email' => 'marie.rasoa@thanasoft.com',
'phone' => '+261341234569',
'job_title' => 'Chef de Projet',
'hire_date' => '2021-08-01',
'active' => true,
],
[
'first_name' => 'Paul',
'last_name' => 'Ramanana',
'email' => 'paul.ramanana@thanasoft.com',
'phone' => '+261341234571',
'job_title' => 'Designer UX/UI',
'hire_date' => '2022-03-10',
'active' => true,
],
[
'first_name' => 'Sophie',
'last_name' => 'Andriamatoa',
'email' => 'sophie.andriamatoa@thanasoft.com',
'phone' => '+261341234573',
'job_title' => 'Responsable RH',
'hire_date' => '2020-09-15',
'active' => true,
],
[
'first_name' => 'David',
'last_name' => 'Randria',
'email' => 'david.randria@thanasoft.com',
'phone' => '+261341234575',
'job_title' => 'Développeur Backend',
'hire_date' => '2023-01-20',
'active' => true,
],
[
'first_name' => 'Lina',
'last_name' => 'Ramaniraka',
'email' => 'lina.ramaniraka@thanasoft.com',
'phone' => '+261341234577',
'job_title' => 'Comptable',
'hire_date' => '2021-06-01',
'active' => true,
],
[
'first_name' => 'Marc',
'last_name' => 'Andriantsoa',
'email' => 'marc.andriantsoa@thanasoft.com',
'phone' => '+261341234579',
'job_title' => 'DevOps Engineer',
'hire_date' => '2022-11-05',
'active' => true,
],
[
'first_name' => 'Julie',
'last_name' => 'Rakotomalala',
'email' => 'julie.rakotomalala@thanasoft.com',
'phone' => '+261341234581',
'job_title' => 'Community Manager',
'hire_date' => '2023-03-15',
'active' => true,
],
[
'first_name' => 'Philippe',
'last_name' => 'Rakoto',
'email' => 'philippe.rakoto@thanasoft.com',
'phone' => '+261341234583',
'job_title' => 'Développeur Mobile',
'hire_date' => '2023-06-10',
'active' => true,
],
[
'first_name' => 'Anne',
'last_name' => 'Andriamanjato',
'email' => 'anne.andriamanjato@thanasoft.com',
'phone' => '+261341234585',
'job_title' => 'Stagiaire',
'hire_date' => '2024-01-15',
'active' => true,
],
];
foreach ($employees as $employeeData) {
Employee::create($employeeData);
}
// Create some inactive employees for testing
Employee::create([
'first_name' => 'Ancien',
'last_name' => 'Employe',
'email' => 'ancien.employe@thanasoft.com',
'phone' => '+261341234587',
'job_title' => 'Testeur',
'hire_date' => '2020-01-01',
'active' => false,
]);
Employee::create([
'first_name' => 'Employe',
'last_name' => 'Suspendu',
'email' => 'employe.suspendu@thanasoft.com',
'phone' => '+261341234589',
'job_title' => 'Assistant',
'hire_date' => '2021-05-01',
'active' => false,
]);
}
}