Skip to content

Why Laravel does not return an item from a collection

I have nested todos. Every todo hasMany todo. I try to get all todos on the same level with staudenmeir/laravel-adjacency-list I have a collection of todos. return $allTodos[0][0]; shows the following result: return $allTodos[0][0]->id; shows 30000000 as expected. Till here everything works well. But if I …

how to search inside two JSON files at a time in PHP

I have two JSON files of same format, forexample 1st JSON File 2nd JSON file Each user has a unique “id”, I want to get their id by searching their name in php, how can I do this This is my PHP script Each user has a unique “id”, I want to get their id by searching their name in

It’s only inserting the last value from a textarea

I’m placing a bunch of emails into a html textarea form. I need to insert the email addresses into my database so I’m using INSERT INTO but for some reason it’s only inserting the last value (email). I’m separating the emails with a line break when placing them into the textarea. (see …

DNS resolver issue Composer 2

Composer version: 2.0.4 OS: macOS 10.15.7 When I run composer diagnose I get DNS resolver issue as seen in the attached image I am able to ping getcomposer.org, packagist.org, github.com – all sites from the terminal. curl -i packagist.org -L also works as expected without any error Yet with composer di…

Printing a nested array on View | Codeigniter

I’m building a cart using sessions, I’m adding each pizza to an array and passing to the session. The array is as follows, I was able to display the item id, pizza name, price, and quantity But cannot figure out to display the topping names user has selected in the Toppings column.How should I do …