Ejemplo n.º 1
0
 public function updateTime($id, $requestData)
 {
     $task = Tasks::findOrFail($id);
     $input = array_replace($requestData->all(), ['fk_task_id' => "{$task->id}"]);
     TaskTime::create($input);
     event(new \App\Events\TaskAction($task, self::UPDATED_TIME));
 }
Ejemplo n.º 2
0
 public function updateTime($id, $requestData)
 {
     $task = Tasks::findOrFail($id);
     $input = array_replace($requestData->all(), ['fk_task_id' => "{$task->id}"]);
     TaskTime::create($input);
     $activityinput = array_merge(['text' => Auth()->user()->name . ' Inserted a new time for this task', 'user_id' => Auth()->id(), 'type' => 'task', 'type_id' => $id]);
     Activity::create($activityinput);
 }
Ejemplo n.º 3
0
 public function newItem($id, $requestData)
 {
     $invoice = invoice::findOrFail($id);
     $tasktimeId = $invoice->tasktime()->first()->fk_task_id;
     $clientid = $invoice->clients()->first()->id;
     $input = array_replace($requestData->all(), ['fk_task_id' => "{$tasktimeId}"]);
     $tasktime = TaskTime::create($input);
     $insertedId = $tasktime->id;
     $invoice->tasktime()->attach($insertedId);
     $invoice->clients()->attach($clientid);
 }