TasksController.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\Task;
  4. use Illuminate\Http\Request;
  5. class TasksController extends Controller
  6. {
  7. /**
  8. * Display a listing of the resource.
  9. *
  10. * @return \Illuminate\Http\Response
  11. */
  12. public function index()
  13. {
  14. $name = 'Fred';
  15. // $tasks = DB::table('tasks')->get();
  16. $tasks = Task::all();
  17. // Return a JSON response from the serialized results.
  18. // return $tasks;
  19. return view('tasks.index', compact('name', 'tasks'));
  20. }
  21. /**
  22. * Show the form for creating a new resource.
  23. *
  24. * @return \Illuminate\Http\Response
  25. */
  26. public function create()
  27. {
  28. //
  29. }
  30. /**
  31. * Store a newly created resource in storage.
  32. *
  33. * @param \Illuminate\Http\Request $request
  34. * @return \Illuminate\Http\Response
  35. */
  36. public function store(Request $request)
  37. {
  38. //
  39. }
  40. /**
  41. * Display the specified resource.
  42. *
  43. * @param \App\Task $task
  44. * @return \Illuminate\Http\Response
  45. */
  46. public function show(Task $task)
  47. {
  48. return view('tasks.show', compact('task'));
  49. }
  50. /**
  51. * Show the form for editing the specified resource.
  52. *
  53. * @param \App\Task $task
  54. * @return \Illuminate\Http\Response
  55. */
  56. public function edit(Task $task)
  57. {
  58. //
  59. }
  60. /**
  61. * Update the specified resource in storage.
  62. *
  63. * @param \Illuminate\Http\Request $request
  64. * @param \App\Task $task
  65. * @return \Illuminate\Http\Response
  66. */
  67. public function update(Request $request, Task $task)
  68. {
  69. //
  70. }
  71. /**
  72. * Remove the specified resource from storage.
  73. *
  74. * @param \App\Task $task
  75. * @return \Illuminate\Http\Response
  76. */
  77. public function destroy(Task $task)
  78. {
  79. //
  80. }
  81. }