EmpleadosController
public function index()
{
//
$tickets = Empleados::all();
return view('empleados.tickets', compact('tickets'));
}
web.php
Route::get('/home', 'HomeController@index')->name('home');
Route::get('/search','EmpleadosController@search');
Route::get('/tickets', 'EmpleadosController@index');
tickets.blade.php
@extends('layouts.app')
@section('content')
<div class="container col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">
<h2> Tickets </h2>
</div>
<table class="table">
<thead>
<tr>
<th>Nombre</th>
<th>Rut</th>
</tr>
</thead>
<tbody>
@foreach($empleados as $empleado)
<tr>
<td>{!! $empleado->Nombre !!} </td>
<td>{!! $empleado->Rut !!}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endsection
Y dá el siguiente error:
Dice que mi variable no existe.