Hi,
i have a select: $roles = agegroup::all();
The select delivers an object with data. Now i need the first two attributes from the object like $first = ??? $second = ???
How can i get the data from the object?
You can use
$data = array();
$objects = agegroup::all();
foreach($objects as $object){
$object->first = 'Example';
$object->second = 'Example 1';
$data[] = $object;
}
$roles = $data;
Hope to help you
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community