Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

get the record form db against array in laravel

$c array include room numbers. how to get all record in a room_number coulmn except room numbers in the array

  $available = array();
foreach ($c as $value) {

    $arooms = DB::table('tbl_rooms')->where('room_number', '<>' , $value)->first();


    array_push($available , $arooms);
  }

return response()->json(['data'=>$available]);

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Its really simple you can do this.

DB::table('tbl_rooms')->whereNotIn('room_number', $c)->get();
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading