Home > Net >  Laravel Model::all() or Model::get problem
Laravel Model::all() or Model::get problem

Time:11-28

I have a project with a database

then i do dd on controller while doing model::get() or model::all()

enter image description here

then i get the result i want like in the first picture

the problem starts from when i create a new project with the same database and the same code, i do model::all() or model::get() but what i get is the result like in the second picture, what should i do to get results like my first project?enter image description here

and thats my problem, how can i get output like picture one? sorry for my bad i am a newbie

CodePudding user response:

try this

model::all()->toArray();
  • Related