I have a book[] input field that comes from the view
$arr = $request->book_name;
dd($arr);
the dd result is like
array:2 [
0 => "1"
1 => "3"
]
I want to select data from the library table where book_id match whit the above array, I wrote the below query but it gives an error like:
Type error: Argument 1 passed to Illuminate\Database\Grammar::parameterize() must be of the type array, string given, called in D
the query is like this:
$libQuantity = \DB::table('library')->select('quantity')->whereIn('book_id', '=', $arr)->get();
LibraryModel