pluck('id')->toArray(); $salaryTypes = SalaryType::where('restaurant_id', $restaurantId)->pluck('id')->toArray(); if (empty($users) || empty($salaryTypes)) { $this->command->info('Please seed Employees and SalaryTypes first.'); return; } foreach ($users as $employeeId) { foreach ($salaryTypes as $typeId) { SalarySetup::updateOrCreate( [ 'employee_id' => $employeeId, 'salary_type_id' => $typeId, 'restaurant_id' => $restaurantId, ], [ 'amount' => rand(1000, 5000), 'calculation_type' => 'fixed', 'status' => 1, ] ); } } $this->command->info('Salary setups seeded successfully.'); } }