I am making a query to the DB from a view with eloquent to print a table, the case is that it works but before the table, where I have the query, it prints the array.
How should I do the query so that it only saves the data to be used in the table but does not print it on the page?
{{ $zero_users = DB::table('empleados')->where('estado', 0)->get() }}
Good day,
In your controller there is a method
show
that is used to return the view that you are going to show, you can pass the response of the query that you make to your database in the following way (Below I show an example that you must adapt to your controller, I do not know the name of your view so I put user.profile):Although I would recommend you first create a variable with your query (This is what you can do
dd()
to see if it returns the correct information