本文整理汇总了PHP中app\Task::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Task::all方法的具体用法?PHP Task::all怎么用?PHP Task::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Task
的用法示例。
在下文中一共展示了Task::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
$tasks = Task::all();
return view('tasks.index')->withTasks($tasks);
//eturn $tasks->all();
}
示例2: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
// 1. No es retorna: paginacion
//return Task::all();
$task = Task::all();
return Response::json(['data' => $this->transformCollection($task)], 200);
}
示例3: tasks
public function tasks()
{
$tasks = Task::all();
// $taskUsers = array();
$view = view('admin.tasks', ['tasks' => $tasks]);
return $view;
}
示例4: update
public function update(Request $request, $id)
{
array_forget($request, "_token");
$all_request = $request->all();
$task = Task::find($id);
foreach ($all_request as $key => $value) {
/*
* remove all underscore contained
* in the edit form field
*/
$key = preg_replace("/^_/", "", $key);
$task->{$key} = $value;
}
if ($task->update()) {
\Session::flash("success_message", "Task Successfully Updated");
} else {
\Session::flash("error_message", "Unexpected Error Task could not be updated");
}
$tasks = Task::all();
if ($request->ajax()) {
response()->json("Task Successfully Updated");
exit;
// return \Redirect::back();
}
return View("taskmanager.index", ['tasks' => $tasks, 'title' => 'Tasks']);
}
示例5: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//1. No és retorna: paginació
//return Task::all();
$task = Task::all();
return $this->respond($this->taskTransformer->transformCollection($task->all()));
}
示例6: index
/**
* Display a list of all of the user's task.
*
* @param Request $request
* @return Response
*/
public function index(Request $request)
{
// return view('tasks.index', [
// 'tasks' => $this->tasks->forUser($request->user()),
// ]);
$tasks = Task::all();
return view('tasks.index', ['tasks' => $tasks]);
}
示例7: index
public function index()
{
//
$user = Auth::user();
// echo $user->name;
$tasks = Task::all();
return view('tasks.index')->withTasks($tasks);
}
示例8: index
public function index()
{
$tasks = Task::all();
//return $tasks;
//return view('task.index',compact('tasks'));
return view('tasks.index', compact('tasks'));
//return view('welcome');
}
示例9: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
if (Sentinel::hasAccess('task.view')) {
$tasks = Task::all();
return view('notifications.tasks.tasks', compact('tasks'));
} else {
return back()->withErrors(['NoAccess' => 'No tiene permisos para acceder a esta area.']);
}
}
示例10: liste
public function liste()
{
if (Auth::user()) {
$id = Auth::user()->id;
}
$tasks = Task::all()->where('user_id', $id);
$lists = Liste::all()->where('user_id', $id);
return view('list', compact('tasks', 'lists'));
}
示例11: todolist
public function todolist()
{
//return View::make('todolist');
$tasks = Task::all();
return View::make('todolist')->with('tasks', $tasks);
//or
// return View::make('todolist', compact('tasks'));
//or
//return View::make('home',['tasks'=> $tasks]);
}
示例12: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$tasks = Task::all();
//
//
//$task = Task::all();
// return $this->respond([
// 'data' => $this->TaskTransformer->transformCollection($task->all())
// ]);
return Response::json($this->TaskTransformer->transformCollection($tasks), 200);
}
示例13: getIndex
public function getIndex()
{
$user = \Auth::user();
$pendings = User::where('standing', 'unconfirmed')->get();
$event = $this->currentEvent();
$committee = Committee::where('event_id', $event->id)->get();
$committees = Committee::all();
$heads = Head::all();
$users = User::all();
$events = Event::all();
$tasks = Task::all();
return view('admin/admin', compact('user', 'users', 'pendings', 'events', 'event', 'heads', 'committee', 'committees', 'tasks'));
}
示例14: index
public function index()
{
//Envoi de mail
/*
Mail::send('emails.test', ['user' => 'ludo'], function ($message) {
$message->from('ludo.troiswa@gmail.com', 'Your Application');
$message->to('ludo.troiswa@gmail.com')->subject('Your Reminder!');
});
*/
$tasks = Task::all();
return view('task.index', compact('tasks'));
}
示例15: randomize
public function randomize()
{
$users = User::all();
$tasks = Task::all();
srand((double) microtime() * 10000);
foreach ($users as $user) {
if (rand(0, 2) == 1) {
$taskExemption = new TaskExemption();
$taskExemption->user_id = $user->id;
$taskExemption->task_id = $tasks[rand(0, count($tasks) - 1)]->id;
$taskExemption->save();
}
}
}