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; }
protected function listPayPlans() { $aPayplans = []; $payplans = PayPlan::all(); if (sizeof($payplans) > 0) { foreach ($payplans as $payplan) { $aPayplans[] = ['id' => $payplan->id, 'title' => $payplan->title]; } } return $aPayplans; }