/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $ctr = 0; $leads = Lead::with(['note'])->where('active', 0)->where('disposition_id', 1)->orWhere('disposition_id', 0)->orderBy('updated_at')->paginate(3); $leads->setPath('/'); return view('user.index', compact('leads', 'ctr')); }
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); }); }
public function getLeads($id, $active = false, $limit = 200) { if ($active) { $operator = '>'; } else { $operator = '>='; } $users = $this->getUserChildren($id); $leadIds = []; $temp = \DB::table('lead_user')->select('lead_id')->whereIn('user_id', $users)->get(); foreach ($temp as $i) { $leadIds[] = $i->lead_id; } $item = Lead::with('users.actions', 'users.parent', 'entity.entity_data', 'entity.contacts.addresses.phones', 'tags')->with(['activities' => function ($query) { $query->orderBy('created_at', 'desc'); }])->where('active', $operator, 0)->whereIn('id', $leadIds)->orderBy('next_action', 'asc')->limit($limit)->get(); return $item; }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // Get all leads $leads = Lead::with(['title', 'source', 'gender', 'stage', 'user'])->get(); return view('leads.index', compact('leads')); }
/** * Display the specified Lead. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { $lead = Lead::with(['entity'])->findOrFail($id); return view('leads.show', compact('lead')); }
public function getLead(Request $request) { return Lead::with('users.actions', 'users.parent', 'entity.entity_data', 'entity.contacts.addresses.phones', 'tags')->with(['activities' => function ($query) { $query->orderBy('created_at', 'desc'); }])->orderBy('next_action', 'asc')->find($request->id); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $statuses = Status::lists('status'); $lead = Lead::with('user')->where('id', $id)->first(); return view('admin.leads.edit_lead', compact('lead', 'statuses')); }