<?php /* |-------------------------------------------------------------------------- | Web Routes |-------------------------------------------------------------------------- | | Here is where you can register web routes for your application. These | routes are loaded by the RouteServiceProvider within a group which | contains the "web" middleware group. Now create something great! | */ /** @var \Illuminate\Routing\Router $this */ $this->get('/tasks', 'TasksController@index'); $this->get('/tasks/{task}', 'TasksController@show'); /* Route::get('/tasks', function () { $name = 'Fred'; // $tasks = DB::table('tasks')->get(); $tasks = Task::all(); // Return a JSON response from the serialized results. // return $tasks; return view('tasks.index', compact('name', 'tasks')); }); Route::get('/tasks/{task}', function ($id) { // $task = DB::table('tasks')->find($id); $task = Task::find($id); // Return a JSON response from the serialized results. // return $tasks; return view('tasks.show', compact('task')); }); */