After setting up the database with migrations and actually migrating them, we have to get data from databases.
We could just do raw sql queries and here are also examples, but we can also use what laravel wants us to do, by using query builders and eloquent queries.

We can easily get all the data or some of the data, by the get command.
Let’s say we get it from the web.php.

Route:get('/', function() {
// $things = DB:table('things')->where('col1', 2)->get();
// it will get things where col1 = 2
  $things = DB:table('things')->get();
  return $things;
});

And it will return json for things.
If we want to pass it to the view, we can simply do
return view('someView', compact('things'); as well.

And in the view, we have to specify the key we are getting because if we want to echo out an object, it won’t work.
That means, we should do something like this

@foreach($things as $thing)
  <li>{{ $thing->name }}</li>
@endforeach

Also, passing indexes can be done in this sense. For example,

Rout::get('things/{id}', function($id) {
  $thing = DB::table('things')->find($id);
  
  return view('tasks/show', compact('thing'));
});

We could also use tasks.show instead of tasks/show.

The one thing I would like to point out is that the id in the curly braces can be anything.
It won’t affect the routing fetching of laravel.
As we have the url routing enabled, we can get along with links through that routes, and a href.