public function option() { $owners = Owner::all(); $data = "<option value='0'>Seleccione</option>"; foreach ($owners as $o) { $data .= sprintf(' <option value="%s">%s</option> ', $o->id, $o->name); } return $data; }
public function fetchOwners() { $json = array(); $owners = Owner::all(); foreach ($owners as $owner) { $json[] = ['name' => $owner->firstName . ' ' . $owner->lastName, 'campaign' => $owner->location, 'id' => $owner->id, 'updated_at' => date('m/d/Y h:i:s A', strtotime($owner->updated_at)), 'slug' => $owner->slug]; } return json_encode($json); }
public static function getOwnerCount() { return count(Owner::all()); }
/** * Show the application welcome screen to the user. * * @return Response */ public function index() { $owners = Owner::all(); return view('home', compact('owners')); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $sites = Site::paginate(); $owners = Owner::all(); return view('admin.sites.index', compact('sites', 'owners')); }