Whats being returned is all the info on the table, ready for further manipulation. You need to tell the DB you have finished your query and to return the rows, this can be done with either first() or get().
I would also recommend using eloquent rather than just the normal DB, an example of how the above query could be done would be:
$user = User::firstOrFail('2'); dd($user);
Hope this helps
Thanxx buddy a lot for your precious time and help ,ya sure ,its helping. and i will definitely move to eloquent. but just my view is if query is incomplete is should return that error else than returning such a big data which hanged my browser and it got crashed.
The data is from you mis-using the object, its not expected to be dumped like that, specific information is mean to be requested. Until you request that specific information it needs to remember all that data to be flexible with (for example) further where statements.
Sometimes its fun to var_dump() (or as I prefer dd() - a function in laravel that dumps and dies) and you can tell a lot of things by doing it. But rarely does it help when playing with the database!
Sign in to participate in this thread!
We'd like to thank these amazing companies for supporting us