You can nudge your life in a new direction every day.

Create a users list in Laravel 8

/app/Http/Controllers/UserController.php

 

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\User;

class UserController extends Controller
{
    //
    public function index()
    {
        $users = User::all();

        return view('users', compact('users'));
    }
}

/routes/web.php 

use App\Http\Controllers\UserController;

Route::get('users', [UserController::class, 'index'])->name('users');

/resources/views/users.blade.php 

@extends('theme.framework')

@section('content')
   
    <main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
        <div class="row">
            <div class="col">
                 <!-- For loop of users -->
                @foreach ($users as $user)
                    <p> {{ $user->name }}</p>
                @endforeach
            </div><!-- /col -->
        </div><!-- /row -->
    </main>

@endsection