I've upgraded my app from Laravel 4.2 to 5.2. This line in the controller grabbed a list of directories:
$directories = DirectoryModel::lists('name', 'id');
and I sent it compacted to the blade to generate a pull-down menu in the blade:
return view('citations.createBlank', compact('citation'), compact('directories'));
In the blade, I used the Form collective to generate the pulldown menu as follows:
Form::select('directory_id', [null=>'Please Select'] + $directories, $citation->directory_id, ['id'=>'directory','class'=>'form-control input-sm js-basic-single','required'])
In Laravel 4.2, $directories was an array in the blade. Now in 5.2 it's a Collection (object) and the blade is throwing an error: Object of class Illuminate\Support\Collection could not be converted to int.
How do I convert this to an array in the Controller? Or do I need to rewrite my blade to generate the pulldown differently?