mturner20
2 years ago

Users List from database using query builder

Posted 2 years ago by mturner20

I have the user list spitting out in an array. I just need help formatting it, so it appears in a list/prettier format.

My code...

My Route Route::get('/users', '[email protected]');

My Controller function

         $users = DB::table('users')->get();
        return view('user.index', ['users' => $users]);
    }

//My Blade file 

```<h1>List of All Users</h1>
     @forelse($users as $user)
     <li>{{ $user->name }}</li>
    @empty
}```

Please sign in or create an account to participate in this conversation.