/** * @param $projectId * @return mixed */ public function create($projectId) { $param['pageNo'] = 1; $param['projectId'] = $projectId; $param['tasks'] = TaskModel::get(); $param['skills'] = SkillModel::lists('name', 'name'); return View::make('company.task.create')->with($param); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index(Request $request) { if ($request->query('list_id') !== NULL) { $list = TodoList::find($request->query('list_id')); $tasks = $list->tasks; } else { $tasks = Task::get(); } return response()->json($tasks); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index(Request $request, $id = Null) { $user = Auth::user(); // If the user is not an Admin, only show his own tasks if ($user->is_admin) { if ($request->is('*/user/*')) { $tasks = Task::where('user_id', $id)->get(); } elseif ($request->is('*/category/*')) { $tasks = Task::where('category_id', $id)->get(); } else { $tasks = Task::get(); } // also retrieve the trashed tasks $trashed = Task::onlyTrashed()->get(); } else { $tasks = Task::where('user_id', $user->id)->get(); // also retrieve the trashed tasks $trashed = Task::onlyTrashed()->get(); } $heading = 'My Tasks'; // return view('tasks', array('tasks' => $tasks, 'heading' => $heading, 'trashed' => $trashed)); }
/** * Send back all tasks as JSON * * @return Response */ public function index() { return response()->json(Task::get()); }
/** * Get all of the tasks for a given user. * * @param User $user * @return Collection */ public function forUser(Task $task, User $user) { return Task::get(); }
public function index() { $tasks = Task::get(); return view('tasks.index')->with('tasks', $tasks); }