lundi 7 mai 2018

Laravel check if Get result exists in json array

I have a query in laravel :

$modules = DB::table('modules')->get();

now I'm sending a list of values from the web to the controller and getting the input like this:

[{id:2, name: "fa"} {id:3, name : "foo"}]

I want to know if result of $modules query, where it s returning id and kitchen, if the id exists in the input that I ve sent : [{id:2, name: "fa"} {id:3, name : "foo"}]



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire