public static function getPayPlanOptions() { $allPayPlans = PayPlan::select('id', 'title')->get(); $aPayPlans = []; if (sizeof($allPayPlans) == 0) { $aPayPlans = ['' => 'There is no pay plan, create one.']; } foreach ($allPayPlans as $data) { $aPayPlans[$data->id] = $data->title; } return $aPayPlans; }