@kclark6595, I'm also new to Laravel, but I'll try my best. (Late edit, I think I misunderstood your question. Shoot :/)
Here's what you need to display data.
1-) A model. I presume that you already have a model, so I skip this part.
2-) A view (You can also display data without using a view)
3-) A controller
Here's my example, I hope you understand better.
Let's define a route. (routes.php)
Route::get('users', 'DashBoardController@listUsers');
Now create a function inside your DashBoardController. Here's my DashBoardController.php file. I added App\Models\User because I'm using the User model that lives in the App\Models folder. I also needed to add namespace because my DashboardController lives in the App\Http\Controllers\Backend\Admin folder.
<?php namespace App\Http\Controllers\Backend\Admin;
use App\Models\User;
use App\Http\Controllers\Controller;
class DashboardController extends Controller {
public function listUsers() {
$users = User::all();
return view('backend.admin.user.index')->with('users', $users);
}
}
If you want to add multiple views, just add another with. As far as I know, there are also two other ways to do it.
return view('backend.admin.user.index')
->with('users', $users)
->with('random',$variable);
index.blade.php (This file is in the views/backend/admin/user folder, check out the dots above! We use dots instead of slash here.)
@foreach($users as $user)
{{$user->user_id}} // I echo all of the ID's in my users table.
@endforeach