/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { list($typeOptions, $userOptions) = $this->getUserOptionsForSelect(); $task = Tasks::with('creator', 'assigned')->find($id); if ($task->scope == 'Everyone') { $task->task_user_id = 'any'; } return view('tasks.edit', compact('task', 'userOptions', 'typeOptions')); }
public function tasksCount($id) { return Tasks::with('creator', 'assigned')->where('task_user_id', $id)->orWhere('Scope', 'Everyone')->todo()->count(); }