获取我从多个选择框中选择的所有ID并更新另一个表 - laravel

I have a form where a user can select multiple tags from a select box. I then need to create the shipment, and after I do that, I need to get all the ID's the user selected from the tags and update another table where the ID matches the tag IDs the user selected.

Here is the select box:

<select name="bins[]" class="form-control" id="shipping_bin_labels_select" multiple="multiple">
     @foreach(\App\Bin::all() as $bin)
          <option value="{{ $bin->id }}"  {{ old('bins') }}>{{ $bin->label }}</option>
     @endforeach
</select>

Here is how it looks:

enter image description here

Then I create the shipment:

  public function store(Request $request)
    {
        $this->validate($request, [
            'truck'      => 'required',
            'bins'       => 'required',
            'stand_id'   => 'required',
        ]);

        $standName = request('stand_id');
        $standName = Stand::where('name', '=', $standName)->first();

        Shipment::create([
            'truck' => request('truck'),
            'stand_id' => $standName->id
        ])->save();

        ...........

After that, I need to loop through all the bin tags, get their IDs and update the 'bins' table with the shipment ID I just made. I don't know how to get all the bins from the bins table with the bin IDs I just selected.

This is what I tried so far:

$bins = $request->input('bins');
$bins = implode(',', $bins);

// Tried this, but get empty collection. [$bins] (brackets) dont help either.
$bins = Bin::whereIn('id', $bins)->get();

// Tried this, but get "Call to a member function all() on string"
$bins = Bin::whereIn('id', $bins->all())->get();


// This is what I sort of need
$bins = Bin::whereIn('id', [3, 5, 6])->get();

For reference, when I DD this:

$bins = $request->input('bins');
$bins = implode(',', $bins);
dd($bins);

I get this:

enter image description here

Those are my bin IDs from the select box. Don't worry about the long ID string, thats how my ID's are formatted and stored in the bins table.

WhereIn accepts an array

->whereIn('id', [1, 2, 3])

If you remove the implode you can pass that array into the query.

so it would become

->whereIn('id', $bins)

You can just do this:

$bins = Bin::whereIn('id', request('bins'))->get();

the whereIn method accepts an array as the second parameter, look here.