如何修复来自select的laravel中的'为foreach()提供的无效参数'错误

I'm setting up a Dynamic Dependant Select Box using laravel form's select but im keep getting that error

My index function

public function index()
{
    $compagnies = Compagnie::all()- 
>pluck("libelle_compagnie","id_compagnie")->toArray();
  return view('pages.quittances')->with('compagnies',$compagnies);
}

The result of $compagnies in tinker

[
     1 => "AXA assurance",
     2 => "AXA assistance",
     3 => "MAROC assistance",
   ]

My select tag

{{ Form::select('compagnies',[''=>'Select compagnies']+$compagnies,null,['class'=>'form-control']) }}

error pic enter image description here

My table in DB

e

enter image description here

 public function index()
 {
    $compagnies = Compagnie::all()->pluck("libelle_compagnie","id_compagnie");
    return view('pages.quittances')->with('compagnies',$compagnies);
 }

just remove toArray() from Compagnie::all()->pluck("libelle_compagnie","id_compagnie") because pluck() will convert object into array automatically.

read [1]: https://laravel.com/docs/5.8/collections#method-pluck for more details.