8889841chome/clixcotz/.trash/app/Console/Commands/ServiceMonthlyTasks.php000064400000002753150443314420021156 0ustar00startOfMonth()->toDateString(); $endOfMonth = $now->endOfMonth()->toDateString(); // Example fetching logic: Modify as per your requirements $clientServices = DB::table('client_services')->get(); foreach ($clientServices as $clientService) { DB::table('tasks')->insert([ 'clientservices_id' => $clientService->id, 'clients_id' => $clientService->client_id, 'start_date' => $startOfMonth, 'end_date' => $endOfMonth, 'created_at' => now(), 'updated_at' => now(), ]); } $this->info('Monthly tasks created successfully.'); } }