public static function collection($workingAreaId) { $leads = Lead::with('gcf')->where('working_area_id', $workingAreaId)->orderBy('updated_at', 'created_at')->get(); return $leads->each(function ($item, $key) { $play = Play::with('gcf')->find($item->play_id); $item->play_name = createPlayName($play->gcf->res_litho, $play->gcf->res_formation, $play->gcf->res_formation_level, $play->gcf->res_age_period, $play->gcf->res_age_epoch, $play->gcf->res_dep_env, $play->gcf->trp_type); }); }
/** * Mencari detail untuk satu Play beserta data GCF. * * @param int @playId * @return \Illuminate\Support\Collection */ public static function detail($playId) { return Play::with('gcf')->findOrFail($playId); }