ErrorException in SitioController.php line 16: Trying to get property of non-object
I have a problem with the code. Any help please?
These are the errors that you get when trying with the code that you have given me
faster your code would be like that;
$data = Configuracion::all();
return view('sitio.index',compact('data'));
and only in the view will you pass the {{ $data->nombre }}
in the error you are trying to get a property that is not an object. when you do the queries usually there is already an array in which the index of that array comes from 0, 1, 2, 3 .... etc .. test and warnings.