Skip to content

Commit

Permalink
Added early drinks; Added date check in CurrentEventController too
Browse files Browse the repository at this point in the history
  • Loading branch information
tdiam committed Mar 22, 2018
1 parent 15a21d2 commit dc3959c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/Http/Controllers/CurrentEventController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@ public function index(Request $request) {
$where = [['visible', true]];
}

$events = Schedule :: where(array_merge($where, [['type', '!=', 'workshop']]))
-> orderBy('hour', 'asc')
-> get();
if(date('Y-m-d') == '2018-03-24') {
$events = Schedule :: where(array_merge($where, [['type', '!=', 'workshop']]))
-> orderBy('hour', 'asc')
-> get();
} else {
$events = collect([]);
}

$curr = $this->getCurr($events);
$next = $this->getNext($events);
Expand Down
19 changes: 19 additions & 0 deletions database/seeds/GeneralEventsSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,25 @@ public function run() {
],
]),

App\Schedule::updateOrCreate(['sid' => 'early-drinks'], [
'hour' => '20:00',
'visible' => true,
'img_src' => '/images/schedule/drinks.jpg',
'type' => 'general',
'event_title' => [
'en' => 'Early drinks',
'el' => 'Early drinks'
],
'event_prev' => [
'en' => '',
'el' => ''
],
'subtitle' => [
'en' => '',
'el' => ''
],
]),

App\Schedule::updateOrCreate(['sid' => 'after-party'], [
'hour' => '21:30',
'visible' => true,
Expand Down
Binary file added public/images/schedule/drinks.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dc3959c

Please sign in to comment.