本文整理汇总了PHP中app\Task::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Task::get方法的具体用法?PHP Task::get怎么用?PHP Task::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Task
的用法示例。
在下文中一共展示了Task::get方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
/**
* @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);
}
示例2: index
/**
* 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);
}
示例3: index
/**
* 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));
}
示例4: index
/**
* Send back all tasks as JSON
*
* @return Response
*/
public function index()
{
return response()->json(Task::get());
}
示例5: forUser
/**
* Get all of the tasks for a given user.
*
* @param User $user
* @return Collection
*/
public function forUser(Task $task, User $user)
{
return Task::get();
}
示例6: index
public function index()
{
$tasks = Task::get();
return view('tasks.index')->with('tasks', $tasks);
}