Answers for "column with array find laravel"

PHP
2

eloquent all only one culomn

$collection = collect([
    ['product_id' => 'prod-100', 'name' => 'Desk'],
    ['product_id' => 'prod-200', 'name' => 'Chair'],
]);

$plucked = $collection->pluck('name');

$plucked->all();

// ['Desk', 'Chair']
Posted by: Guest on May-21-2020
0

laravel where in array

$items = Item::whereIn('id', [1,2,..])->get();
Posted by: Guest on September-24-2020

Browse Popular Code Answers by Language