If you want to call users table from database , you must to send the array from the controller ,and into the view you can call it. I think you can send many arrays or variable from the controller . I used the same model what Lavarel has by default.
<?php namespace App\Http\Controllers;
use App\User;
class Menu extends Controller {
public function prueba()
{
$users = User::get();
return view('prueba',compact('users'));
}
?>
<table >
<tr>
<th>ID</th>
<th>nombre</th>
<th>email</th>
<th>actions</th>
</tr>
@foreach($users as $user)
<tr>
<td>{!! $user->id !!}</td>
<td>{!! $user->name !!}</td>
<td>{!! $user->email !!}</td>
<td>
<a href="">Edit</a>
<a href="">Delete</a>
</td>
</tr>
@endforeach
</table>
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community