This is the error message:
ErrorException
Undefined variable $evento (View: /path/public_html/resources/views/admin/prelectores/index.blade.php)
This is function
class PreletorController extends Controller
{
/**
* Display a listing of the resource.
*
* @return IlluminateHttpResponse
*/
public function index($id)
{
$evento = Evento::find($id);
$participantes = $evento->participantes()->where('participante_como','Prelector')->get();
//dd($participantes[0]->preletor);
return view('admin.prelectores.index', compact('participantes', 'evento'));
}
Route::get('{id}/preletores/index', [PreletorController::class, 'index'])->name('prelector.index');