/** * Run the database seeds. * * @return void */ public function run() { // SET UP NEW CARBON DATES $_old = '2016/san-antonio'; $_new = (object) ['slug' => '2017/san-antonio', 'published' => Carbon::create(2016, 01, 18, 16, 30, 00), 'start' => Carbon::create(2017, 01, 18, 07, 00, 00), 'end' => Carbon::create(2017, 01, 18, 16, 30, 00)]; // DELETE DUPLICATES $conference = Conference::where('slug', '=', $_new->slug)->delete(); $forceDel = Conference::onlyTrashed()->forceDelete(); $agenda = Agenda::where('conference_slug', '=', $_new->slug)->delete(); $forceDel = Agenda::onlyTrashed()->forceDelete(); $option = Option::where('slug', '=', $_new->slug)->delete(); $forceDel = Option::onlyTrashed()->forceDelete(); unset($conference, $agenda, $option, $forceDel); // RESCHEDULE CONFERENCE $conference = Conference::where('slug', '=', $_old)->update(['slug' => $_new->slug, 'start_date' => $_new->start, 'end_date' => $_new->end, 'published' => $_new->published]); // UPDATE OPTIONS $option = Option::where('slug', '=', $_old)->update(['slug' => $_new->slug]); // UPDATE AGENDA $agendas = Agenda::where('conference_slug', '=', $_old)->get(); foreach ($agendas as $agenda) { $agenda->conference_slug = $_new->slug; $agenda->timeslot = $_new->start->format('Y-m-d') . ' ' . $agenda->timeslot->format('H:i:s'); $agenda->save(); } // UPDATE SPEAKERS $speakers = Speaker::where('conference_slug', '=', $_old)->update(['conference_slug' => $_new->slug]); }
public function index() { $route = Helpers::routeinfo(); if (!isset($route->params) || !isset($route->params['conference'])) { $events = Conference::where('start_date', '>', Carbon::now())->published()->orderBy('start_date')->get(); } else { $events = Conference::where(function ($query) use($route) { $query->where('slug', '=', $route->params['conference'])->orWhere('city', 'like', '%' . $route->params['conference'] . '%')->orWhere('state', 'like', '%' . $route->params['conference'] . '%')->orWhere('tags', 'like', '%' . $route->params['conference'] . '%'); })->published()->orderBy('start_date', 'asc')->get(); } $events = $this->collectionToArray($events); $allEvents = Lookup::lookup('conferences', $route->params, ['published' => true]); $events = Lookup::lookup('conferences', $route->params, ['upcoming' => true, 'current' => true, 'published' => true]); if (count($events) > 1) { return $this->conferences($route, $events); } elseif (count($events) === 1) { return $this->conference($route, $events[0]); } elseif (count($allEvents) > 1) { return $this->conferences($route, $events); } elseif (count($allEvents) === 1) { return $this->conference($route, $allEvents[0]); } elseif ($route->action === '{conference?}') { return redirect('/'); } else { return redirect('/conferences'); } }
public function testStore() { $this->login($this->ADMIN); $this->post('/api/conferences', $this->TEST_DATA, $this->header); $this->assertResponseOk(); $this->seeInDatabase('conferences', $this->TEST_DATA); $cid = Conference::where('name', $this->TEST_DATA['name'])->first()->getKey(); $this->get('/api/conferences/' . $cid); $this->seeJson($this->TEST_DATA); $this->get('/api/conferences/' . $cid . '/managers'); $this->seeJson(['username' => 'admin']); $this->logout(); }
protected function getEvents() { $events = ['' => 'Select one...']; $conferences = Conference::where('start_date', '>', Carbon::now())->get(); $conferences = Helpers::keysByField($conferences, 'slug'); foreach ($conferences as $slug => $event) { $events[$slug] = $event->city . ', ' . $event->state . ' | '; $time = $event->start_date . (!empty($event->timezone) ? $event->timezone : ''); if (!empty($event->coming)) { $events[$slug] .= date('F Y', strtotime($time)); } else { $events[$slug] .= date('F j, Y', strtotime($time)); } } return $events; }
/** * Run the database seeds. * * @return void */ public function run() { // $benefit = Benefit::where('text', 'like', '%Fortune 100-5000%')->get(); if (is_array($benefit) && count($benefit) > 0 && isset($benefit[0]->text)) { $text = str_replace('fortune 100-5000', 'Fortune 100-3000', $benefit[0]->text); $text = str_replace('ΓÇÖ', "'", $text); $update = Benefit::where('text', 'like', '%Fortune 100-5000%')->update(['text' => $text]); } $events = Conference::where('about', 'like', '%Fortune 100-5000%')->get(); foreach ($events as $event) { unset($text); $text = str_replace('fortune 100-5000', 'Fortune 100-3000', $event->about); $text = str_replace('ΓÇÖ', "'", $text); Conference::where('slug', '=', $event->slug)->where('about', 'like', '%Fortune 100-5000%')->update(['about' => $text]); } }
/** * Run the database seeds. * * @return void */ public function run() { // SET UP NEW CARBON DATES $_old = '2017/tampa'; $_new = (object) ['slug' => '2017/tampa', 'published' => Carbon::create(2016, 03, 02, 16, 30, 00), 'start' => Carbon::create(2017, 03, 02, 07, 00, 00), 'end' => Carbon::create(2017, 03, 02, 16, 30, 00)]; // RESCHEDULE CONFERENCE $conference = Conference::where('slug', '=', $_old)->update(['slug' => $_new->slug, 'start_date' => $_new->start, 'end_date' => $_new->end, 'published' => $_new->published]); // UPDATE OPTIONS $options = Option::insert(['slug' => '2017/tampa', 'option' => 'show_upcoming', 'value' => 0, 'published' => Carbon::now()]); // UPDATE AGENDA $agendas = Agenda::where('conference_slug', '=', $_old)->get(); foreach ($agendas as $agenda) { $agenda->conference_slug = $_new->slug; $agenda->timeslot = $_new->start->format('Y-m-d') . ' ' . $agenda->timeslot->format('H:i:s'); $agenda->save(); } // UPDATE SPEAKERS $speakers = Speaker::where('conference_slug', '=', $_old)->update(['conference_slug' => $_new->slug]); }
public function index() { $route = Helpers::routeinfo(); $route->url = '/contact'; $options = Helpers::options($route); $navs = Helpers::navigation($route, $options); $sub = Helpers::navigation($route, $options, true); $contact = (object) ['venue' => 'Acclaim Events', 'phone' => '(503) 206-5700', 'phone_short' => '5032065700', 'address' => '9860 SW Hall Blvd, Suite D<br>Tigard, OR 97223', 'address_short' => '9860 SW Hall Blvd, Suite D, Tigard, OR 97223', 'facebook' => 'http://www.facebook.com/acclaimeventsllc', 'linkedin' => 'https://www.linkedin.com/company/acclaim-events-llc', 'place' => 'ChIJE5F6JvIMlVQR05xT-zTHqwk']; $event = (object) []; if (count($route->params) === 1 || $route->uri === 'contact/sponsorship/{conference?}') { if (!empty($route->params['contact'])) { $team = DB::table('team_members')->where('first_name', '=', ucwords($route->params['contact']))->take(1)->get(); if (is_array($team) && count($team) === 1) { $team = $team[0]; $options->title = 'Contact ' . $team->first_name; $contact->first_name = $team->first_name; $contact->last_name = $team->last_name; $contact->photo = $team->photo; $route->url = '/contact/' . $route->params['contact']; } else { redirect('/contact'); } } elseif ($route->uri === 'contact/sponsorship/{conference?}') { if (!empty($route->params['conference'])) { $events = Conference::where('slug', '=', $route->params['conference'])->where('start_date', '>', Carbon::now())->published()->take(1)->get(); if (is_object($events)) { $event = (object) $events[0]->toArray(); } } } else { redirect('/contact'); } } // dd($route); return view('pages/contact', compact('contact', 'event', 'route', 'options', 'navs', 'sub')); }
/** * Retrieve all Conferences of a certain status. * * @param Request $request * @param string $status * @return Collection|Response */ public function indexWithStatus(Request $request, $status) { try { return Conference::where('status', $status)->get(); } catch (Exception $e) { return response()->error(); } }
/** * Run the database seeds. * * @return void */ public function run() { // Conference::where('slug', '=', '2016/austin')->orWhere('slug', '=', '2017/austin')->update(['published' => null]); }