芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/qrafiqxcreativeagency.com/accounts/office/database/seeders/LeaveSeeder.php
pluck('id')->toArray(); $leaveTypes = LeaveType::where('company_id', $companyId)->get()->pluck('id')->toArray(); $employee = $employees[array_rand($employees)]; $leaveType = $leaveTypes[array_rand($leaveTypes)]; $count = config('app.seed_record_count'); \App\Models\Leave::factory()->count((int)$count)->make()->each(function (Leave $leave)use($companyId, $leaveType, $employee){ $leave->user_id = $employee; $leave->leave_type_id = $leaveType; $leave->company_id = $companyId; $leave->save(); }); } }