|
@@ -11,9 +11,12 @@
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
+use App\Task;
|
|
|
+
|
|
|
Route::get('/tasks', function () {
|
|
|
$name = 'Fred';
|
|
|
- $tasks = DB::table('tasks')->get();
|
|
|
+ // $tasks = DB::table('tasks')->get();
|
|
|
+ $tasks = Task::all();
|
|
|
|
|
|
// Return a JSON response from the serialized results.
|
|
|
// return $tasks;
|
|
@@ -22,7 +25,8 @@ Route::get('/tasks', function () {
|
|
|
});
|
|
|
|
|
|
Route::get('/tasks/{task}', function ($id) {
|
|
|
- $task = DB::table('tasks')->find($id);
|
|
|
+ // $task = DB::table('tasks')->find($id);
|
|
|
+ $task = Task::find($id);
|
|
|
|
|
|
// Return a JSON response from the serialized results.
|
|
|
// return $tasks;
|