public function index() { $model_rating = model_rating::where('rating_status', '1')->pluck('rating_name', 'rating_id')->toArray(); $model_bfield = model_business_field::where(array('bfield_status' => '1'))->get(); $model_bfield_parent = model_business_field::where('bfield_status', '1')->orderBy('bfield_name')->pluck('bfield_name', 'bfield_id')->toArray(); $model_bfield_parent = ['0' => 'No Parent'] + $model_bfield_parent; return view('backend.bfield.index')->with(['model_bfield' => $model_bfield, 'model_bfield_parent' => $model_bfield_parent, 'model_rating' => $model_rating]); }
public function rating() { $split1 = explode(",", $this->bfield_rating); $data = array(); foreach ($split1 as $rating_id) { $data[] = model_rating::find($rating_id); } return $data; }