├── public ├── favicon.ico ├── robots.txt ├── googleb47f0721f1d4845a.html ├── light-logo.png ├── css │ └── jumbotron.css ├── .htaccess └── index.php ├── database ├── seeds │ ├── .gitkeep │ └── DatabaseSeeder.php ├── .gitignore ├── migrations │ ├── .gitkeep │ ├── 2016_10_25_021745_add_is_admin.php │ ├── 2016_09_20_002119_create_teams_table.php │ ├── 2016_09_20_003938_create_game_team_table.php │ ├── 2016_09_20_002055_create_games_table.php │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2016_10_03_205920_add_listener_status.php │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2017_09_27_041228_change_game_code_field.php │ └── 2016_10_02_215453_create_jobs_table.php └── factories │ └── ModelFactory.php ├── resources ├── views │ ├── vendor │ │ ├── .gitkeep │ │ ├── mail │ │ │ ├── markdown │ │ │ │ ├── panel.blade.php │ │ │ │ ├── table.blade.php │ │ │ │ ├── footer.blade.php │ │ │ │ ├── promotion.blade.php │ │ │ │ ├── subcopy.blade.php │ │ │ │ ├── button.blade.php │ │ │ │ ├── header.blade.php │ │ │ │ ├── promotion │ │ │ │ │ └── button.blade.php │ │ │ │ ├── layout.blade.php │ │ │ │ └── message.blade.php │ │ │ └── html │ │ │ │ ├── table.blade.php │ │ │ │ ├── header.blade.php │ │ │ │ ├── subcopy.blade.php │ │ │ │ ├── promotion.blade.php │ │ │ │ ├── footer.blade.php │ │ │ │ ├── panel.blade.php │ │ │ │ ├── promotion │ │ │ │ └── button.blade.php │ │ │ │ ├── message.blade.php │ │ │ │ ├── button.blade.php │ │ │ │ ├── layout.blade.php │ │ │ │ └── themes │ │ │ │ └── default.css │ │ ├── pagination │ │ │ ├── simple-default.blade.php │ │ │ ├── simple-bootstrap-4.blade.php │ │ │ ├── default.blade.php │ │ │ └── bootstrap-4.blade.php │ │ └── notifications │ │ │ └── email.blade.php │ ├── admin │ │ ├── landing.blade.php │ │ ├── partials │ │ │ ├── nav.blade.php │ │ │ └── header │ │ │ │ └── header.blade.php │ │ ├── game-status │ │ │ └── game-status.blade.php │ │ ├── layouts │ │ │ └── admin.blade.php │ │ └── layout │ │ │ └── admin.blade.php │ ├── errors │ │ └── 503.twig │ ├── partials │ │ └── header │ │ │ └── header.blade.php │ ├── welcome.blade.php │ ├── auth │ │ ├── passwords │ │ │ ├── email.blade.php │ │ │ └── reset.blade.php │ │ ├── login.blade.php │ │ └── register.blade.php │ └── layouts │ │ └── main.blade.php ├── lang │ └── en │ │ ├── pagination.php │ │ ├── auth.php │ │ ├── passwords.php │ │ └── validation.php └── assets │ ├── js │ ├── app.js │ ├── components │ │ └── Example.vue │ └── bootstrap.js │ └── sass │ ├── variables.scss │ └── app.scss ├── bootstrap ├── cache │ └── .gitignore ├── autoload.php └── app.php ├── storage ├── logs │ └── .gitignore ├── app │ ├── public │ │ └── .gitignore │ └── .gitignore └── framework │ ├── cache │ └── .gitignore │ ├── views │ └── .gitignore │ ├── sessions │ └── .gitignore │ └── .gitignore ├── .gitattributes ├── .idea ├── copyright │ └── profiles_settings.xml ├── blade.xml ├── modules.xml ├── goalfeed.local.iml └── misc.xml ├── app ├── Services │ ├── GameService.php │ ├── BaseService.php │ └── TeamService.php ├── Http │ ├── Middleware │ │ ├── EncryptCookies.php │ │ ├── VerifyCsrfToken.php │ │ ├── Admin.php │ │ └── RedirectIfAuthenticated.php │ ├── Controllers │ │ ├── Controller.php │ │ ├── InfoController.php │ │ ├── Auth │ │ │ ├── ResetPasswordController.php │ │ │ ├── ForgotPasswordController.php │ │ │ ├── LoginController.php │ │ │ └── RegisterController.php │ │ └── AdminController.php │ └── Kernel.php ├── EngineMiscFunctions.php ├── Providers │ ├── BroadcastServiceProvider.php │ ├── AuthServiceProvider.php │ ├── EventServiceProvider.php │ ├── AppServiceProvider.php │ └── RouteServiceProvider.php ├── Events │ └── Goal.php ├── Console │ ├── Commands │ │ ├── sendTestEvent.php │ │ ├── scheduleListeners.php │ │ ├── ListenerSafetyNet.php │ │ ├── GetGamesForDate.php │ │ ├── getGamesForDate.php │ │ └── GameListener.php │ └── Kernel.php ├── Message.php ├── Team.php ├── Jobs │ └── MessageSender.php ├── Game.php ├── Exceptions │ └── Handler.php └── User.php ├── tests ├── ExampleTest.php └── TestCase.php ├── package.json ├── routes ├── console.php ├── api.php └── web.php ├── gulpfile.js ├── .env.example ├── server.php ├── readme.md ├── phpunit.xml ├── config ├── compile.php ├── services.php ├── view.php ├── broadcasting.php ├── filesystems.php ├── queue.php ├── cache.php ├── auth.php ├── database.php ├── mail.php ├── ide-helper.php ├── session.php ├── twigbridge.php ├── bugsnag.php └── app.php ├── .gitignore ├── composer.json └── artisan /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /database/seeds/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /database/migrations/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /resources/views/vendor/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/markdown/panel.blade.php: -------------------------------------------------------------------------------- 1 | {{ $slot }} 2 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/markdown/table.blade.php: -------------------------------------------------------------------------------- 1 | {{ $slot }} 2 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/markdown/footer.blade.php: -------------------------------------------------------------------------------- 1 | {{ $slot }} 2 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/markdown/promotion.blade.php: -------------------------------------------------------------------------------- 1 | {{ $slot }} 2 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/markdown/subcopy.blade.php: -------------------------------------------------------------------------------- 1 | {{ $slot }} 2 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/markdown/button.blade.php: -------------------------------------------------------------------------------- 1 | {{ $slot }}: {{ $url }} 2 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/markdown/header.blade.php: -------------------------------------------------------------------------------- 1 | [{{ $slot }}]({{ $url }}) 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | -------------------------------------------------------------------------------- /public/googleb47f0721f1d4845a.html: -------------------------------------------------------------------------------- 1 | google-site-verification: googleb47f0721f1d4845a.html -------------------------------------------------------------------------------- /resources/views/vendor/mail/markdown/promotion/button.blade.php: -------------------------------------------------------------------------------- 1 | [{{ $slot }}]({{ $url }}) 2 | -------------------------------------------------------------------------------- /public/light-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cviebrock/goalfeed/master/public/light-logo.png -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /resources/views/admin/landing.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layouts.admin') 2 | 3 | @section('content') 4 | 5 | @endsection 6 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/html/table.blade.php: -------------------------------------------------------------------------------- 1 |
2 | {{ Illuminate\Mail\Markdown::parse($slot) }} 3 |
4 | -------------------------------------------------------------------------------- /app/Services/GameService.php: -------------------------------------------------------------------------------- 1 | 2 |
3 | Game Status 4 |
5 | -------------------------------------------------------------------------------- /.idea/blade.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/Services/BaseService.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ $slot }} 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/markdown/layout.blade.php: -------------------------------------------------------------------------------- 1 | {!! strip_tags($header) !!} 2 | 3 | {!! strip_tags($slot) !!} 4 | @isset($subcopy) 5 | 6 | {!! strip_tags($subcopy) !!} 7 | @endisset 8 | 9 | {!! strip_tags($footer) !!} 10 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/html/subcopy.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 |
4 | {{ Illuminate\Mail\Markdown::parse($slot) }} 5 |
8 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/html/promotion.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 |
4 | {{ Illuminate\Mail\Markdown::parse($slot) }} 5 |
8 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/goalfeed.local.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(UsersTableSeeder::class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/html/footer.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | visit('/') 17 | ->see('Laravel'); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/html/panel.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 13 |
4 | 5 | 6 | 9 | 10 |
7 | {{ Illuminate\Mail\Markdown::parse($slot) }} 8 |
11 |
14 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/html/promotion/button.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 13 |
4 | 5 | 6 | 9 | 10 |
7 | {{ $slot }} 8 |
11 |
14 | -------------------------------------------------------------------------------- /app/EngineMiscFunctions.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/Http/Middleware/Admin.php: -------------------------------------------------------------------------------- 1 | isAdmin()) { 24 | return $next($request); 25 | } 26 | 27 | return redirect('/'); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 18 | }); 19 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | user(); 18 | })->middleware('auth:api'); 19 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | const elixir = require('laravel-elixir'); 2 | 3 | require('laravel-elixir-vue'); 4 | 5 | /* 6 | |-------------------------------------------------------------------------- 7 | | Elixir Asset Management 8 | |-------------------------------------------------------------------------- 9 | | 10 | | Elixir provides a clean, fluent API for defining some basic Gulp tasks 11 | | for your Laravel application. By default, we are compiling the Sass 12 | | file for our application, as well as publishing vendor resources. 13 | | 14 | */ 15 | 16 | elixir(mix => { 17 | mix.sass('app.scss') 18 | .webpack('app.js'); 19 | }); 20 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_ENV=local 2 | APP_KEY= 3 | APP_DEBUG=true 4 | APP_LOG_LEVEL=debug 5 | APP_URL=http://localhost 6 | 7 | DB_CONNECTION=mysql 8 | DB_HOST=127.0.0.1 9 | DB_PORT=3306 10 | DB_DATABASE=homestead 11 | DB_USERNAME=homestead 12 | DB_PASSWORD=secret 13 | 14 | BROADCAST_DRIVER=log 15 | CACHE_DRIVER=file 16 | SESSION_DRIVER=file 17 | QUEUE_DRIVER=sync 18 | 19 | REDIS_HOST=127.0.0.1 20 | REDIS_PASSWORD=null 21 | REDIS_PORT=6379 22 | 23 | MAIL_DRIVER=smtp 24 | MAIL_HOST=mailtrap.io 25 | MAIL_PORT=2525 26 | MAIL_USERNAME=null 27 | MAIL_PASSWORD=null 28 | MAIL_ENCRYPTION=null 29 | 30 | PUSHER_KEY= 31 | PUSHER_SECRET= 32 | PUSHER_APP_ID= 33 | -------------------------------------------------------------------------------- /database/migrations/2016_10_25_021745_add_is_admin.php: -------------------------------------------------------------------------------- 1 | boolean('is_admin')->default(false); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() { 29 | // 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Redirect Trailing Slashes If Not A Folder... 9 | RewriteCond %{REQUEST_FILENAME} !-d 10 | RewriteRule ^(.*)/$ /$1 [L,R=301] 11 | 12 | # Handle Front Controller... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_FILENAME} !-f 15 | RewriteRule ^ index.php [L] 16 | 17 | # Handle Authorization Header 18 | RewriteCond %{HTTP:Authorization} . 19 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 20 | 21 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to test a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | make(Illuminate\Contracts\Console\Kernel::class)->bootstrap(); 22 | 23 | return $app; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /resources/assets/js/app.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * First we will load all of this project's JavaScript dependencies which 4 | * include Vue and Vue Resource. This gives a great starting point for 5 | * building robust, powerful web applications using Vue and Laravel. 6 | */ 7 | 8 | require('./bootstrap'); 9 | 10 | /** 11 | * Next, we will create a fresh Vue application instance and attach it to 12 | * the body of the page. From here, you may begin adding components to 13 | * the application, or feel free to tweak this setup for your needs. 14 | */ 15 | 16 | Vue.component('example', require('./components/Example.vue')); 17 | 18 | const app = new Vue({ 19 | el: 'body' 20 | }); 21 | -------------------------------------------------------------------------------- /resources/assets/js/components/Example.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 24 | -------------------------------------------------------------------------------- /app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | check()) { 24 | return redirect('/home'); 25 | } 26 | 27 | return $next($request); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | id === (int) $userId; 26 | }); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /app/Providers/AuthServiceProvider.php: -------------------------------------------------------------------------------- 1 | 'App\Policies\ModelPolicy', 19 | ]; 20 | 21 | /** 22 | * Register any authentication / authorization services. 23 | * 24 | * @return void 25 | */ 26 | public function boot() 27 | { 28 | $this->registerPolicies(); 29 | // 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /resources/views/vendor/pagination/simple-default.blade.php: -------------------------------------------------------------------------------- 1 | @if ($paginator->hasPages()) 2 | 17 | @endif 18 | -------------------------------------------------------------------------------- /app/Providers/EventServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 19 | 'App\Listeners\EventListener', 20 | ], 21 | ]; 22 | 23 | /** 24 | * Register any events for your application. 25 | * 26 | * @return void 27 | */ 28 | public function boot() 29 | { 30 | parent::boot(); 31 | // 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Goalfeed - Backend 2 | 3 | I don't have time to continue actively developing this, so I'm opening this up. 4 | 5 | While you could build a standalone app that would repeatedly poll in this manner, I'm not sure how kindly the NHL would take to all the added frequent requests. By doing it from a single source and then announcing goals to all listeners via pusher, it reduces the traffic to the NHL gamecentre scoreboards 6 | 7 | Laravel based back-end for the goalfeed service. 8 | 9 | Most of the magic happens takes place within the commands which are located in app/Console/Commands and scheduled within app/Console/Kernel.php 10 | 11 | To get up and running, copy .env.example to .env, run the migrations, configure pusher and cron the scheduler. See Laravel 5.3 docs for more details -------------------------------------------------------------------------------- /app/Services/TeamService.php: -------------------------------------------------------------------------------- 1 | teams()->get() as $addedTeam) { 15 | if ($addedTeam->team_code == $team->team_code) { 16 | return true; 17 | } 18 | } 19 | 20 | return false; 21 | } 22 | 23 | public static function assignTeamsToGame(Game $game, array $teams) 24 | { 25 | foreach ($teams as $team) { 26 | if (!self::isTeamAssignedToGame($team, $game)) { 27 | $team->games()->save($game); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/html/message.blade.php: -------------------------------------------------------------------------------- 1 | @component('mail::layout') 2 | {{-- Header --}} 3 | @slot('header') 4 | @component('mail::header', ['url' => config('app.url')]) 5 | {{ config('app.name') }} 6 | @endcomponent 7 | @endslot 8 | 9 | {{-- Body --}} 10 | {{ $slot }} 11 | 12 | {{-- Subcopy --}} 13 | @isset($subcopy) 14 | @slot('subcopy') 15 | @component('mail::subcopy') 16 | {{ $subcopy }} 17 | @endcomponent 18 | @endslot 19 | @endisset 20 | 21 | {{-- Footer --}} 22 | @slot('footer') 23 | @component('mail::footer') 24 | © {{ date('Y') }} {{ config('app.name') }}. All rights reserved. 25 | @endcomponent 26 | @endslot 27 | @endcomponent 28 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/markdown/message.blade.php: -------------------------------------------------------------------------------- 1 | @component('mail::layout') 2 | {{-- Header --}} 3 | @slot('header') 4 | @component('mail::header', ['url' => config('app.url')]) 5 | {{ config('app.name') }} 6 | @endcomponent 7 | @endslot 8 | 9 | {{-- Body --}} 10 | {{ $slot }} 11 | 12 | {{-- Subcopy --}} 13 | @isset($subcopy) 14 | @slot('subcopy') 15 | @component('mail::subcopy') 16 | {{ $subcopy }} 17 | @endcomponent 18 | @endslot 19 | @endisset 20 | 21 | {{-- Footer --}} 22 | @slot('footer') 23 | @component('mail::footer') 24 | © {{ date('Y') }} {{ config('app.name') }}. All rights reserved. 25 | @endcomponent 26 | @endslot 27 | @endcomponent 28 | -------------------------------------------------------------------------------- /database/factories/ModelFactory.php: -------------------------------------------------------------------------------- 1 | define(App\User::class, function (Faker\Generator $faker) { 15 | static $password; 16 | 17 | return [ 18 | 'name' => $faker->name, 19 | 'email' => $faker->safeEmail, 20 | 'password' => $password ?: $password = bcrypt('secret'), 21 | 'remember_token' => str_random(10), 22 | ]; 23 | }); 24 | -------------------------------------------------------------------------------- /database/migrations/2016_09_20_002119_create_teams_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->text('team_code'); 19 | $table->text('team_name'); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('teams'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Controllers/InfoController.php: -------------------------------------------------------------------------------- 1 | sortBy('team_name'); 18 | $responseObject = []; 19 | 20 | foreach ($teams as $team) { 21 | $teamInfo = [ 22 | 'team_name' => $team->team_name, 23 | 'team_code' => strtolower($team->team_code), 24 | ]; 25 | 26 | $responseObject[] = $teamInfo; 27 | } 28 | 29 | $response = new JsonResponse(); 30 | $response->setData($responseObject); 31 | 32 | return $response; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /database/migrations/2016_09_20_003938_create_game_team_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->integer('game_id',false,true); 19 | $table->integer('team_id',false,true); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('game_team'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/html/button.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 18 | 19 |
4 | 5 | 6 | 15 | 16 |
7 | 8 | 9 | 12 | 13 |
10 | {{ $slot }} 11 |
14 |
17 |
20 | -------------------------------------------------------------------------------- /database/migrations/2016_09_20_002055_create_games_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->timestamps(); 19 | $table->integer('start_time', false, true); 20 | $table->text('game_code'); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::dropIfExists('games'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Events/Goal.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token')->index(); 19 | $table->timestamp('created_at')->nullable(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::drop('password_resets'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2016_10_03_205920_add_listener_status.php: -------------------------------------------------------------------------------- 1 | string('listener_status')->default(Game::GAME_LISTENER_STATUS_IDLE); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | // 31 | Schema::table('games', function ($table) { 32 | $table->dropColumn('listener_status'); 33 | }); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Passwords must be at least six characters and match the confirmation.', 17 | 'reset' => 'Your password has been reset!', 18 | 'sent' => 'We have e-mailed your password reset link!', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that e-mail address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /resources/views/vendor/pagination/simple-bootstrap-4.blade.php: -------------------------------------------------------------------------------- 1 | @if ($paginator->hasPages()) 2 | 17 | @endif 18 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | app->alias('bugsnag.logger', \Illuminate\Contracts\Logging\Log::class); 30 | $this->app->alias('bugsnag.logger', \Psr\Log\LoggerInterface::class); 31 | 32 | if ($this->app->environment() !== 'production') { 33 | $this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('name'); 19 | $table->string('email')->unique(); 20 | $table->string('password'); 21 | $table->rememberToken(); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::drop('users'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /resources/views/errors/503.twig: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Be right back. 5 | 6 | 7 | 8 | 39 | 40 | 41 |
42 |
43 |
Be right back.
44 |
45 |
46 | 47 | 48 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | name('admin.game-status'); 26 | 27 | Route::get('/test-goal', 'AdminController@testGoal'); 28 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ResetPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /resources/assets/sass/variables.scss: -------------------------------------------------------------------------------- 1 | 2 | // Body 3 | $body-bg: #f5f8fa; 4 | 5 | // Borders 6 | $laravel-border-color: darken($body-bg, 10%); 7 | $list-group-border: $laravel-border-color; 8 | $navbar-default-border: $laravel-border-color; 9 | $panel-default-border: $laravel-border-color; 10 | $panel-inner-border: $laravel-border-color; 11 | 12 | // Brands 13 | $brand-primary: #3097D1; 14 | $brand-info: #8eb4cb; 15 | $brand-success: #2ab27b; 16 | $brand-warning: #cbb956; 17 | $brand-danger: #bf5329; 18 | 19 | // Typography 20 | $font-family-sans-serif: "Raleway", sans-serif; 21 | $font-size-base: 14px; 22 | $line-height-base: 1.6; 23 | $text-color: #636b6f; 24 | 25 | // Navbar 26 | $navbar-default-bg: #fff; 27 | 28 | // Buttons 29 | $btn-default-color: $text-color; 30 | 31 | // Inputs 32 | $input-border: lighten($text-color, 40%); 33 | $input-border-focus: lighten($brand-primary, 25%); 34 | $input-color-placeholder: lighten($text-color, 30%); 35 | 36 | // Panels 37 | $panel-default-heading-bg: #fff; 38 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ForgotPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests 14 | 15 | 16 | 17 | 18 | ./app 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/Console/Commands/sendTestEvent.php: -------------------------------------------------------------------------------- 1 | channelId = 'goals'; 24 | $this->messageType = self::MESSAGE_TYPE_GOAL; 25 | $this->payload = $team; 26 | } 27 | 28 | public function isSendable() 29 | { 30 | $sendable = true; 31 | 32 | if (!$this->payload) { 33 | $sendable = false; 34 | } 35 | 36 | if (!$this->messageType) { 37 | $sendable = false; 38 | } 39 | 40 | return $sendable; 41 | } 42 | 43 | public function toMessageJson() 44 | { 45 | $message = [ 46 | 'team' => $this->payload, 47 | ]; 48 | 49 | return json_encode($message); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /database/migrations/2017_09_27_041228_change_game_code_field.php: -------------------------------------------------------------------------------- 1 | truncate(); 18 | 19 | Schema::table('games', function (Blueprint $table) { 20 | $table->dropColumn('game_code'); 21 | }); 22 | Schema::table('games', function (Blueprint $table) { 23 | $table->integer('game_code')->unique(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | // 35 | Schema::table('games', function (Blueprint $table) { 36 | 37 | $table->dropColumn('game_code'); 38 | $table->string('game_code'); 39 | 40 | }); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /database/migrations/2016_10_02_215453_create_jobs_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->string('queue'); 19 | $table->longText('payload'); 20 | $table->tinyInteger('attempts')->unsigned(); 21 | $table->unsignedInteger('reserved_at')->nullable(); 22 | $table->unsignedInteger('available_at'); 23 | $table->unsignedInteger('created_at'); 24 | $table->index(['queue', 'reserved_at']); 25 | }); 26 | } 27 | 28 | /** 29 | * Reverse the migrations. 30 | * 31 | * @return void 32 | */ 33 | public function down() 34 | { 35 | Schema::dropIfExists('jobs'); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/Team.php: -------------------------------------------------------------------------------- 1 | belongsToMany('App\Game', 'game_team', 'team_id', 'game_id'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /config/compile.php: -------------------------------------------------------------------------------- 1 | [ 17 | // 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled File Providers 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may list service providers which define a "compiles" function 26 | | that returns additional files that should be compiled, providing an 27 | | easy way to get common files from any packages you are utilizing. 28 | | 29 | */ 30 | 31 | 'providers' => [ 32 | // 33 | ], 34 | 35 | ]; 36 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | ], 21 | 22 | 'ses' => [ 23 | 'key' => env('SES_KEY'), 24 | 'secret' => env('SES_SECRET'), 25 | 'region' => 'us-east-1', 26 | ], 27 | 28 | 'sparkpost' => [ 29 | 'secret' => env('SPARKPOST_SECRET'), 30 | ], 31 | 32 | 'stripe' => [ 33 | 'model' => App\User::class, 34 | 'key' => env('STRIPE_KEY'), 35 | 'secret' => env('STRIPE_SECRET'), 36 | ], 37 | 38 | ]; 39 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | realpath(base_path('resources/views')), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => realpath(storage_path('framework/views')), 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/LoginController.php: -------------------------------------------------------------------------------- 1 | middleware('guest', ['except' => 'logout']); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /bootstrap/autoload.php: -------------------------------------------------------------------------------- 1 | 2 |
3 | 13 | 14 | 34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /resources/views/welcome.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.main', ['jumbotron' => true]) 2 | 3 | @section('jumbotron') 4 |
5 |
6 |
7 | 8 |
9 |
10 |
11 |

Goalfeed.ca

12 |

Goalfeed provides nearly instant notifications every time a goal is scored in the NHL.

13 |

Currently, we offer an extension for Google Chrome to trigger a goal-light light sequence for your Philips Hue lights.

14 |

15 | Check us out in the Chrome Store! 16 |

17 |
18 |
19 | @endsection 20 | 21 | @section('content') 22 | 23 |
24 |
25 |

Fast!

26 |

Goalfeed is the fastest NHL trigger source for your Philips Hue lights.

27 |
28 |
29 |

Growing!

30 |

We're working to add support for additional sports and leagues as well as clients for other platforms!

31 |
32 |
33 | @endsection 34 | -------------------------------------------------------------------------------- /resources/views/vendor/notifications/email.blade.php: -------------------------------------------------------------------------------- 1 | @component('mail::message') 2 | {{-- Greeting --}} 3 | @if (! empty($greeting)) 4 | # {{ $greeting }} 5 | @else 6 | @if ($level == 'error') 7 | # Whoops! 8 | @else 9 | # Hello! 10 | @endif 11 | @endif 12 | 13 | {{-- Intro Lines --}} 14 | @foreach ($introLines as $line) 15 | {{ $line }} 16 | 17 | @endforeach 18 | 19 | {{-- Action Button --}} 20 | @isset($actionText) 21 | 33 | @component('mail::button', ['url' => $actionUrl, 'color' => $color]) 34 | {{ $actionText }} 35 | @endcomponent 36 | @endisset 37 | 38 | {{-- Outro Lines --}} 39 | @foreach ($outroLines as $line) 40 | {{ $line }} 41 | 42 | @endforeach 43 | 44 | {{-- Salutation --}} 45 | @if (! empty($salutation)) 46 | {{ $salutation }} 47 | @else 48 | Regards,
{{ config('app.name') }} 49 | @endif 50 | 51 | {{-- Subcopy --}} 52 | @isset($actionText) 53 | @component('mail::subcopy') 54 | If you’re having trouble clicking the "{{ $actionText }}" button, copy and paste the URL below 55 | into your web browser: [{{ $actionUrl }}]({{ $actionUrl }}) 56 | @endcomponent 57 | @endisset 58 | @endcomponent 59 | -------------------------------------------------------------------------------- /app/Console/Commands/scheduleListeners.php: -------------------------------------------------------------------------------- 1 | ', time()) 45 | ->where('start_time', '<=', time() + 3660) 46 | ->where('listener_status', '=', Game::GAME_LISTENER_STATUS_IDLE) 47 | ->get(); 48 | 49 | foreach ($gamesToStart as $game) { 50 | $command = 'nhl:game-listener ' . $game->game_code; 51 | call_in_background($command); 52 | $this->output->writeln('running ' . $command); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('nhl:start-games') 36 | ->hourly(); 37 | 38 | $schedule->command('nhl:rescue-games')->everyFiveMinutes(); 39 | 40 | $schedule->command('nhl:get-games') 41 | ->daily(); 42 | } 43 | 44 | /** 45 | * Register the Closure based commands for the application. 46 | * 47 | * @return void 48 | */ 49 | protected function commands() 50 | { 51 | require base_path('routes/console.php'); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /resources/views/vendor/pagination/default.blade.php: -------------------------------------------------------------------------------- 1 | @if ($paginator->hasPages()) 2 | 36 | @endif 37 | -------------------------------------------------------------------------------- /app/Http/Controllers/AdminController.php: -------------------------------------------------------------------------------- 1 | middleware('admin'); 18 | } 19 | 20 | public function getAdminDash() 21 | { 22 | return view('admin.landing'); 23 | } 24 | 25 | public function getGameStatus() 26 | { 27 | $timeBack = time() - 86400; 28 | $games = Game::where('start_time', '>', $timeBack) 29 | ->orderBy('start_time', 'asc') 30 | ->limit(20) 31 | ->get(); 32 | 33 | return view('admin.game-status.game-status', ['games' => $games]); 34 | } 35 | 36 | public function getStartListener($gamecode) 37 | { 38 | $game = Game::whereGameCode($gamecode)->first(); 39 | 40 | if ($game && ($game->listener_status == Game::GAME_LISTENER_STATUS_IDLE || $game->listener_status == Game::GAME_LISTENER_STATUS_DONE)) { 41 | $command = 'nhl:game-listener ' . $game->game_code; 42 | call_in_background($command); 43 | 44 | return redirect()->route('admin.game-status'); 45 | } 46 | } 47 | 48 | public function testGoal() 49 | { 50 | $message = new Message('wpg'); 51 | dispatch(new MessageSender($message)); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /resources/assets/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | 2 | window._ = require('lodash'); 3 | 4 | /** 5 | * We'll load jQuery and the Bootstrap jQuery plugin which provides support 6 | * for JavaScript based Bootstrap features such as modals and tabs. This 7 | * code may be modified to fit the specific needs of your application. 8 | */ 9 | 10 | window.$ = window.jQuery = require('jquery'); 11 | require('bootstrap-sass'); 12 | 13 | /** 14 | * Vue is a modern JavaScript library for building interactive web interfaces 15 | * using reactive data binding and reusable components. Vue's API is clean 16 | * and simple, leaving you to focus on building your next great project. 17 | */ 18 | 19 | window.Vue = require('vue'); 20 | require('vue-resource'); 21 | 22 | /** 23 | * We'll register a HTTP interceptor to attach the "CSRF" header to each of 24 | * the outgoing requests issued by this application. The CSRF middleware 25 | * included with Laravel will automatically verify the header's value. 26 | */ 27 | 28 | Vue.http.interceptors.push((request, next) => { 29 | request.headers['X-CSRF-TOKEN'] = Laravel.csrfToken; 30 | 31 | next(); 32 | }); 33 | 34 | /** 35 | * Echo exposes an expressive API for subscribing to channels and listening 36 | * for events that are broadcast by Laravel. Echo and event broadcasting 37 | * allows your team to easily build robust real-time web applications. 38 | */ 39 | 40 | // import Echo from "laravel-echo" 41 | 42 | // window.Echo = new Echo({ 43 | // broadcaster: 'pusher', 44 | // key: 'your-pusher-key' 45 | // }); 46 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.gitignore.io/api/laravel,phpstorm 3 | 4 | ### Laravel ### 5 | /bootstrap/compiled.php 6 | /vendor 7 | /node_modules 8 | Homestead.yaml 9 | Homestead.json 10 | .env.local.php 11 | .env.php 12 | .env 13 | composer.phar 14 | composer.lock 15 | 16 | 17 | ### PhpStorm ### 18 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm 19 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 20 | 21 | .idea/ 22 | 23 | # User-specific stuff: 24 | .idea/workspace.xml 25 | .idea/tasks.xml 26 | .idea/dictionaries 27 | .idea/vcs.xml 28 | .idea/jsLibraryMappings.xml 29 | 30 | # Sensitive or high-churn files: 31 | .idea/dataSources.ids 32 | .idea/dataSources.xml 33 | .idea/dataSources.local.xml 34 | .idea/sqlDataSources.xml 35 | .idea/dynamic.xml 36 | .idea/uiDesigner.xml 37 | 38 | # Gradle: 39 | .idea/gradle.xml 40 | .idea/libraries 41 | 42 | # Mongo Explorer plugin: 43 | .idea/mongoSettings.xml 44 | 45 | ## File-based project format: 46 | *.iws 47 | 48 | ## Plugin-specific files: 49 | 50 | # IntelliJ 51 | /out/ 52 | 53 | # mpeltonen/sbt-idea plugin 54 | .idea_modules/ 55 | 56 | # JIRA plugin 57 | atlassian-ide-plugin.xml 58 | 59 | # Crashlytics plugin (for Android Studio and IntelliJ) 60 | com_crashlytics_export_strings.xml 61 | crashlytics.properties 62 | crashlytics-build.properties 63 | fabric.properties 64 | 65 | ### PhpStorm Patch ### 66 | # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 67 | 68 | # *.iml 69 | # modules.xml 70 | # .idea/misc.xml 71 | # *.ipr -------------------------------------------------------------------------------- /resources/views/admin/game-status/game-status.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layouts.admin') 2 | 3 | @section('content') 4 | 5 |
6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | @foreach($games as $game) 18 | 19 | 20 | 21 | 29 | 34 | 35 | @endforeach 36 | 37 |
GamecodeStart Time (Central Time)TeamsListener Status
{{$game->game_code}}{{$game->readableStartTime()}} 22 | 23 |
    24 | @foreach($game->teams as $team) 25 |
  • {{$team->team_name}}
  • 26 | @endforeach 27 |
28 |
{{$game->listener_status}}
30 | @if($game->listener_status == 'idle' || $game->listener_status == 'done' ) 31 | Start Listener 32 | @endif 33 |
38 |
39 |
40 | 41 | @endsection 42 | -------------------------------------------------------------------------------- /resources/views/admin/partials/header/header.blade.php: -------------------------------------------------------------------------------- 1 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /app/Jobs/MessageSender.php: -------------------------------------------------------------------------------- 1 | channel = $message->channelId; 32 | $this->messageType = $message->messageType; 33 | $this->messageToSend = $message->toMessageJson(); 34 | } 35 | 36 | /** 37 | * Execute the job. 38 | * 39 | * @return void 40 | */ 41 | public function handle() 42 | { 43 | $this->sendPusher(); 44 | $this->sendSlanger(); 45 | } 46 | 47 | private function sendPusher() 48 | { 49 | $pusher = new Pusher(env('PUSHER_KEY'), env('PUSHER_SECRET'), env('PUSHER_APP_ID')); 50 | 51 | $pusher->trigger($this->channel, $this->messageType, $this->messageToSend); 52 | } 53 | 54 | private function sendSlanger() 55 | { 56 | $pusher = new Pusher(env('SLANGER_KEY'), env('SLANGER_SECRET'), env('SLANGER_APP_ID'), [], 57 | env('SLANGER_APP_HOST'), 4567); 58 | 59 | $pusher->trigger($this->channel, $this->messageType, $this->messageToSend); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /resources/views/vendor/pagination/bootstrap-4.blade.php: -------------------------------------------------------------------------------- 1 | @if ($paginator->hasPages()) 2 | 36 | @endif 37 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_KEY'), 36 | 'secret' => env('PUSHER_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | // 40 | ], 41 | ], 42 | 43 | 'redis' => [ 44 | 'driver' => 'redis', 45 | 'connection' => 'default', 46 | ], 47 | 48 | 'log' => [ 49 | 'driver' => 'log', 50 | ], 51 | 52 | 'null' => [ 53 | 'driver' => 'null', 54 | ], 55 | 56 | ], 57 | 58 | ]; 59 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "description": "The Laravel Framework.", 4 | "keywords": ["framework", "laravel"], 5 | "license": "MIT", 6 | "type": "project", 7 | "require": { 8 | "php": ">=5.6.4", 9 | "laravel/framework": "5.3.*", 10 | "ixudra/curl": "6.*", 11 | "barryvdh/laravel-ide-helper": "^2.2", 12 | "pusher/pusher-php-server": "^2.6", 13 | "illuminated/helper-functions": "^1.0", 14 | "rcrowe/twigbridge": "^0.9.3", 15 | "bugsnag/bugsnag-laravel": "^2.0" 16 | }, 17 | "require-dev": { 18 | "fzaninotto/faker": "~1.4", 19 | "mockery/mockery": "0.9.*", 20 | "phpunit/phpunit": "~5.0", 21 | "symfony/css-selector": "3.1.*", 22 | "symfony/dom-crawler": "3.1.*", 23 | "doctrine/dbal": "~2.3" 24 | }, 25 | "autoload": { 26 | "classmap": [ 27 | "database" 28 | ], 29 | "psr-4": { 30 | "App\\": "app/" 31 | } 32 | }, 33 | "autoload-dev": { 34 | "classmap": [ 35 | "tests/TestCase.php" 36 | ] 37 | }, 38 | "scripts": { 39 | "post-root-package-install": [ 40 | "php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 41 | ], 42 | "post-create-project-cmd": [ 43 | "php artisan key:generate" 44 | ], 45 | "post-install-cmd": [ 46 | "Illuminate\\Foundation\\ComposerScripts::postInstall", 47 | "php artisan optimize" 48 | ], 49 | "post-update-cmd": [ 50 | "Illuminate\\Foundation\\ComposerScripts::postUpdate", 51 | "php artisan optimize" 52 | ] 53 | }, 54 | "config": { 55 | "preferred-install": "dist" 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 32 | 33 | $status = $kernel->handle( 34 | $input = new Symfony\Component\Console\Input\ArgvInput, 35 | new Symfony\Component\Console\Output\ConsoleOutput 36 | ); 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Shutdown The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once Artisan has finished running. We will fire off the shutdown events 44 | | so that any final work may be done by the application before we shut 45 | | down the process. This is the last thing to happen to the request. 46 | | 47 | */ 48 | 49 | $kernel->terminate($input, $status); 50 | 51 | exit($status); 52 | -------------------------------------------------------------------------------- /app/Console/Commands/ListenerSafetyNet.php: -------------------------------------------------------------------------------- 1 | where('start_time', '>', $timeBack) 52 | ->whereNotIn('listener_status', [Game::GAME_LISTENER_STATUS_ACTIVE, Game::GAME_LISTENER_STATUS_WAITING]) 53 | ->get(); 54 | 55 | $this->output->writeln('Count: ' . $gamesToRescue->count() . ' timeback: ' . $timeBack . ' timeahead: ' . $timeAhead); 56 | 57 | if ($gamesToRescue->count() > 0) { 58 | 59 | foreach ($gamesToRescue as $game) { 60 | $command = 'nhl:game-listener ' . $game->game_code; 61 | call_in_background($command); 62 | $this->output->writeln('running ' . $command); 63 | } 64 | Bugsnag::notifyError('Game Rescue', 'A game had to be rescued. Please investigate'); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /app/Game.php: -------------------------------------------------------------------------------- 1 | belongsToMany('App\Team', 'game_team', 'game_id', 'team_id'); 46 | } 47 | 48 | public function readableStartTime($locale = 'America/Winnipeg') 49 | { 50 | $startTime = Carbon::createFromTimestampUTC($this->start_time); 51 | 52 | $startTime->setTimezone($locale); 53 | 54 | return $startTime->toDateTimeString(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | /* 11 | |-------------------------------------------------------------------------- 12 | | Register The Auto Loader 13 | |-------------------------------------------------------------------------- 14 | | 15 | | Composer provides a convenient, automatically generated class loader for 16 | | our application. We just need to utilize it! We'll simply require it 17 | | into the script here so that we don't have to worry about manual 18 | | loading any of our classes later on. It feels nice to relax. 19 | | 20 | */ 21 | 22 | require __DIR__.'/../bootstrap/autoload.php'; 23 | 24 | /* 25 | |-------------------------------------------------------------------------- 26 | | Turn On The Lights 27 | |-------------------------------------------------------------------------- 28 | | 29 | | We need to illuminate PHP development, so let us turn on the lights. 30 | | This bootstraps the framework and gets it ready for use, then it 31 | | will load up this application so that we can run it and send 32 | | the responses back to the browser and delight our users. 33 | | 34 | */ 35 | 36 | $app = require_once __DIR__.'/../bootstrap/app.php'; 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Run The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once we have the application, we can handle the incoming request 44 | | through the kernel, and send the associated response back to 45 | | the client's browser allowing them to enjoy the creative 46 | | and wonderful application we have prepared for them. 47 | | 48 | */ 49 | 50 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); 51 | 52 | $response = $kernel->handle( 53 | $request = Illuminate\Http\Request::capture() 54 | ); 55 | 56 | $response->send(); 57 | 58 | $kernel->terminate($request, $response); 59 | -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | [ 29 | \App\Http\Middleware\EncryptCookies::class, 30 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 31 | \Illuminate\Session\Middleware\StartSession::class, 32 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 33 | \App\Http\Middleware\VerifyCsrfToken::class, 34 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 35 | ], 36 | 37 | 'api' => [ 38 | 'throttle:60,1', 39 | 'bindings', 40 | ], 41 | ]; 42 | 43 | /** 44 | * The application's route middleware. 45 | * 46 | * These middleware may be assigned to groups or used individually. 47 | * 48 | * @var array 49 | */ 50 | protected $routeMiddleware = [ 51 | 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, 52 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 53 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 54 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 55 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 56 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 57 | 'admin' => \App\Http\Middleware\Admin::class, 58 | ]; 59 | } 60 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | mapWebRoutes(); 40 | 41 | $this->mapApiRoutes(); 42 | // 43 | } 44 | 45 | /** 46 | * Define the "web" routes for the application. 47 | * 48 | * These routes all receive session state, CSRF protection, etc. 49 | * 50 | * @return void 51 | */ 52 | protected function mapWebRoutes() 53 | { 54 | Route::group([ 55 | 'middleware' => 'web', 56 | 'namespace' => $this->namespace, 57 | ], function($router) { 58 | require base_path('routes/web.php'); 59 | }); 60 | } 61 | 62 | /** 63 | * Define the "api" routes for the application. 64 | * 65 | * These routes are typically stateless. 66 | * 67 | * @return void 68 | */ 69 | protected function mapApiRoutes() 70 | { 71 | Route::group([ 72 | 'middleware' => 'api', 73 | 'namespace' => $this->namespace, 74 | 'prefix' => 'api', 75 | ], function($router) { 76 | require base_path('routes/api.php'); 77 | }); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/html/layout.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 25 | 26 | 27 | 28 | 51 | 52 |
29 | 30 | {{ $header or '' }} 31 | 32 | 33 | 34 | 46 | 47 | 48 | {{ $footer or '' }} 49 |
35 | 36 | 37 | 38 | 43 | 44 |
39 | {{ Illuminate\Mail\Markdown::parse($slot) }} 40 | 41 | {{ $subcopy or '' }} 42 |
45 |
50 |
53 | 54 | 55 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/RegisterController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 42 | } 43 | 44 | /** 45 | * Get a validator for an incoming registration request. 46 | * 47 | * @param array $data 48 | * 49 | * @return \Illuminate\Contracts\Validation\Validator 50 | */ 51 | protected function validator(array $data) 52 | { 53 | return Validator::make($data, [ 54 | 'name' => 'required|max:255', 55 | 'email' => 'required|email|max:255|unique:users', 56 | 'password' => 'required|min:6|confirmed', 57 | ]); 58 | } 59 | 60 | /** 61 | * Create a new user instance after a valid registration. 62 | * 63 | * @param array $data 64 | * 65 | * @return User 66 | */ 67 | protected function create(array $data) 68 | { 69 | return User::create([ 70 | 'name' => $data['name'], 71 | 'email' => $data['email'], 72 | 'password' => bcrypt($data['password']), 73 | ]); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 65 | return response()->json(['error' => 'Unauthenticated.'], 401); 66 | } 67 | 68 | return redirect()->guest('login'); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /app/User.php: -------------------------------------------------------------------------------- 1 | is_admin; // this looks for an admin column in your users table 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | 'local', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Default Cloud Filesystem Disk 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Many applications store files both locally and in the cloud. For this 26 | | reason, you may specify a default "cloud" driver here. This driver 27 | | will be bound as the Cloud disk implementation in the container. 28 | | 29 | */ 30 | 31 | 'cloud' => 's3', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Filesystem Disks 36 | |-------------------------------------------------------------------------- 37 | | 38 | | Here you may configure as many filesystem "disks" as you wish, and you 39 | | may even configure multiple disks of the same driver. Defaults have 40 | | been setup for each driver as an example of the required options. 41 | | 42 | */ 43 | 44 | 'disks' => [ 45 | 46 | 'local' => [ 47 | 'driver' => 'local', 48 | 'root' => storage_path('app'), 49 | ], 50 | 51 | 'public' => [ 52 | 'driver' => 'local', 53 | 'root' => storage_path('app/public'), 54 | 'visibility' => 'public', 55 | ], 56 | 57 | 's3' => [ 58 | 'driver' => 's3', 59 | 'key' => 'your-key', 60 | 'secret' => 'your-secret', 61 | 'region' => 'your-region', 62 | 'bucket' => 'your-bucket', 63 | ], 64 | 65 | ], 66 | 67 | ]; 68 | -------------------------------------------------------------------------------- /resources/views/auth/passwords/email.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.main') 2 | 3 | 4 | @section('content') 5 |
6 |
7 |
8 |
9 |
Reset Password
10 |
11 | @if (session('status')) 12 |
13 | {{ session('status') }} 14 |
15 | @endif 16 | 17 |
18 | {{ csrf_field() }} 19 | 20 |
21 | 22 | 23 |
24 | 25 | 26 | @if ($errors->has('email')) 27 | 28 | {{ $errors->first('email') }} 29 | 30 | @endif 31 |
32 |
33 | 34 |
35 |
36 | 39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | @endsection 48 | -------------------------------------------------------------------------------- /resources/assets/sass/app.scss: -------------------------------------------------------------------------------- 1 | 2 | // Fonts 3 | @import url(https://fonts.googleapis.com/css?family=Raleway:300,400,600); 4 | 5 | // Variables 6 | @import "variables"; 7 | 8 | // Bootstrap 9 | @import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap"; 10 | 11 | .text-left-not-xs, .text-left-not-sm, .text-left-not-md, .text-left-not-lg { 12 | text-align: left; 13 | } 14 | 15 | .text-center-not-xs, .text-center-not-sm, .text-center-not-md, .text-center-not-lg { 16 | text-align: center; 17 | } 18 | 19 | .text-right-not-xs, .text-right-not-sm, .text-right-not-md, .text-right-not-lg { 20 | text-align: right; 21 | } 22 | 23 | .text-justify-not-xs, .text-justify-not-sm, .text-justify-not-md, .text-justify-not-lg { 24 | text-align: justify; 25 | } 26 | 27 | @media (max-width: 767px) { 28 | .text-left-not-xs, .text-center-not-xs, .text-right-not-xs, .text-justify-not-xs { 29 | text-align: inherit; 30 | } 31 | .text-left-xs { 32 | text-align: left; 33 | } 34 | .text-center-xs { 35 | text-align: center; 36 | } 37 | .text-right-xs { 38 | text-align: right; 39 | } 40 | .text-justify-xs { 41 | text-align: justify; 42 | } 43 | } 44 | 45 | @media (min-width: 768px) and (max-width: 991px) { 46 | .text-left-not-sm, .text-center-not-sm, .text-right-not-sm, .text-justify-not-sm { 47 | text-align: inherit; 48 | } 49 | .text-left-sm { 50 | text-align: left; 51 | } 52 | .text-center-sm { 53 | text-align: center; 54 | } 55 | .text-right-sm { 56 | text-align: right; 57 | } 58 | .text-justify-sm { 59 | text-align: justify; 60 | } 61 | } 62 | 63 | @media (min-width: 992px) and (max-width: 1199px) { 64 | .text-left-not-md, .text-center-not-md, .text-right-not-md, .text-justify-not-md { 65 | text-align: inherit; 66 | } 67 | .text-left-md { 68 | text-align: left; 69 | } 70 | .text-center-md { 71 | text-align: center; 72 | } 73 | .text-right-md { 74 | text-align: right; 75 | } 76 | .text-justify-md { 77 | text-align: justify; 78 | } 79 | } 80 | 81 | @media (min-width: 1200px) { 82 | .text-left-not-lg, .text-center-not-lg, .text-right-not-lg, .text-justify-not-lg { 83 | text-align: inherit; 84 | } 85 | .text-left-lg { 86 | text-align: left; 87 | } 88 | .text-center-lg { 89 | text-align: center; 90 | } 91 | .text-right-lg { 92 | text-align: right; 93 | } 94 | .text-justify-lg { 95 | text-align: justify; 96 | } 97 | } 98 | 99 | .logo { 100 | width: 100%; 101 | } 102 | 103 | .jumbotron { 104 | background-color: #CC0000; 105 | color: #ffffff; 106 | } 107 | 108 | .header-logo { 109 | width: 5%; 110 | } 111 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_DRIVER', 'sync'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Queue Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may configure the connection information for each server that 26 | | is used by your application. A default configuration has been added 27 | | for each back-end shipped with Laravel. You are free to add more. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'sync' => [ 34 | 'driver' => 'sync', 35 | ], 36 | 37 | 'database' => [ 38 | 'driver' => 'database', 39 | 'table' => 'jobs', 40 | 'queue' => 'default', 41 | 'retry_after' => 90, 42 | ], 43 | 44 | 'beanstalkd' => [ 45 | 'driver' => 'beanstalkd', 46 | 'host' => 'localhost', 47 | 'queue' => 'default', 48 | 'retry_after' => 90, 49 | ], 50 | 51 | 'sqs' => [ 52 | 'driver' => 'sqs', 53 | 'key' => 'your-public-key', 54 | 'secret' => 'your-secret-key', 55 | 'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id', 56 | 'queue' => 'your-queue-name', 57 | 'region' => 'us-east-1', 58 | ], 59 | 60 | 'redis' => [ 61 | 'driver' => 'redis', 62 | 'connection' => 'default', 63 | 'queue' => 'default', 64 | 'retry_after' => 90, 65 | ], 66 | 67 | ], 68 | 69 | /* 70 | |-------------------------------------------------------------------------- 71 | | Failed Queue Jobs 72 | |-------------------------------------------------------------------------- 73 | | 74 | | These options configure the behavior of failed queue job logging so you 75 | | can control which database and table are used to store the jobs that 76 | | have failed. You may change them to any database / table you wish. 77 | | 78 | */ 79 | 80 | 'failed' => [ 81 | 'database' => env('DB_CONNECTION', 'mysql'), 82 | 'table' => 'failed_jobs', 83 | ], 84 | 85 | ]; 86 | -------------------------------------------------------------------------------- /resources/views/layouts/main.blade.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 21 | 22 | Goalfeed.ca - Trigger Philips Hue lights when your favourite NHL team scores 23 | 24 | 25 | 26 | 27 | 28 | 33 | 50 | 51 | 52 | 53 | @include('partials.header.header') 54 | 55 | @if ($showJumbo) 56 |
57 |
58 | @yield('jumbotron') 59 |
60 |
61 | @endif 62 | 63 | 64 |
65 | @yield('content') 66 |
67 | 68 | 71 |
72 | 73 | 74 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /app/Console/Commands/GetGamesForDate.php: -------------------------------------------------------------------------------- 1 | argument("days") ? $this->argument("days") : 7; 50 | $offset = $this->argument("offset") ? $this->argument("offset") : 0; 51 | 52 | $urlRoot = "https://statsapi.web.nhl.com"; 53 | 54 | $date = Carbon::today(); 55 | $date->addDays($offset); 56 | $date->timezone('America/Toronto'); 57 | $daysProcessed = 0; 58 | 59 | $progress = new ProgressBar($this->output); 60 | $progress->start($days); 61 | 62 | while ($daysProcessed < $days) { 63 | $scoreboardURL = $urlRoot . "/api/v1/schedule?startDate=" . $date->format('Y-n-d') . "&endDate=" . $date->format('Y-n-d') . "&expand=schedule.teams,schedule.linescore,schedule.broadcasts.all,schedule.ticket,schedule.game.content.media.epg,schedule.radioBroadcasts,schedule.metadata,schedule.game.seriesSummary,seriesSummary.series&leaderCategories=&leaderGameTypes=R&site=en_nhlCA&teamId=&gameType=&timecode="; 64 | $this->output->writeln($scoreboardURL); 65 | $response = Curl::to($scoreboardURL)->get(); 66 | 67 | if ($response) { 68 | 69 | $scoreboard = json_decode($response, false); 70 | //var_dump($scoreboard); 71 | if (!empty($scoreboard->dates)) { 72 | 73 | foreach ($scoreboard->dates[0]->games as $game) { 74 | 75 | //die(); 76 | $homeTeam = Team::firstOrCreate(['team_code' => $game->teams->home->team->abbreviation, 'team_name' => ucwords(strtolower($game->teams->home->team->name))]); 77 | $awayTeam = Team::firstOrCreate(['team_code' => $game->teams->away->team->abbreviation, 'team_name' => ucwords(strtolower($game->teams->away->team->name))]); 78 | 79 | $startTime = Carbon::parse($game->gameDate); 80 | $curGame = Game::firstOrCreate(['game_code' => $game->gamePk, 'start_time' => $startTime->timestamp]); 81 | 82 | TeamService::assignTeamsToGame($curGame,[$homeTeam, $awayTeam]); 83 | } 84 | 85 | } 86 | } 87 | $date->addDay(); 88 | $daysProcessed++; 89 | $progress->advance(); 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /resources/views/admin/layouts/admin.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 18 | 19 | Goalfeed.ca - Trigger Philips Hue lights when your favourite NHL team scores 20 | 21 | 22 | 23 | 24 | 25 | 30 | 47 | 48 | 49 | 50 | @include('admin.partials.header.header') 51 | 52 | @include('admin.partials.nav') 53 | 54 | 55 |
56 | @yield('content') 57 |
58 | 59 | 62 |
63 | 64 | 65 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Cache Stores 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the cache "stores" for your application as 26 | | well as their drivers. You may even define multiple stores for the 27 | | same cache driver to group types of items stored in your caches. 28 | | 29 | */ 30 | 31 | 'stores' => [ 32 | 33 | 'apc' => [ 34 | 'driver' => 'apc', 35 | ], 36 | 37 | 'array' => [ 38 | 'driver' => 'array', 39 | ], 40 | 41 | 'database' => [ 42 | 'driver' => 'database', 43 | 'table' => 'cache', 44 | 'connection' => null, 45 | ], 46 | 47 | 'file' => [ 48 | 'driver' => 'file', 49 | 'path' => storage_path('framework/cache'), 50 | ], 51 | 52 | 'memcached' => [ 53 | 'driver' => 'memcached', 54 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 55 | 'sasl' => [ 56 | env('MEMCACHED_USERNAME'), 57 | env('MEMCACHED_PASSWORD'), 58 | ], 59 | 'options' => [ 60 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 61 | ], 62 | 'servers' => [ 63 | [ 64 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 65 | 'port' => env('MEMCACHED_PORT', 11211), 66 | 'weight' => 100, 67 | ], 68 | ], 69 | ], 70 | 71 | 'redis' => [ 72 | 'driver' => 'redis', 73 | 'connection' => 'default', 74 | ], 75 | 76 | ], 77 | 78 | /* 79 | |-------------------------------------------------------------------------- 80 | | Cache Key Prefix 81 | |-------------------------------------------------------------------------- 82 | | 83 | | When utilizing a RAM based store such as APC or Memcached, there might 84 | | be other applications utilizing the same cache. So, we'll specify a 85 | | value to get prefixed to all our keys so we can avoid collisions. 86 | | 87 | */ 88 | 89 | 'prefix' => 'laravel', 90 | 91 | ]; 92 | -------------------------------------------------------------------------------- /resources/views/auth/login.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.main') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Login
9 |
10 |
11 | {{ csrf_field() }} 12 | 13 |
14 | 15 | 16 |
17 | 18 | 19 | @if ($errors->has('email')) 20 | 21 | {{ $errors->first('email') }} 22 | 23 | @endif 24 |
25 |
26 | 27 |
28 | 29 | 30 |
31 | 32 | 33 | @if ($errors->has('password')) 34 | 35 | {{ $errors->first('password') }} 36 | 37 | @endif 38 |
39 |
40 | 41 |
42 |
43 |
44 | 47 |
48 |
49 |
50 | 51 |
52 |
53 | 56 | 57 | 58 | Forgot Your Password? 59 | 60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 | @endsection 69 | -------------------------------------------------------------------------------- /app/Console/Commands/getGamesForDate.php: -------------------------------------------------------------------------------- 1 | argument("days") ? $this->argument("days") : 7; 53 | $offset = $this->argument("offset") ? $this->argument("offset") : 0; 54 | 55 | $urlRoot = "https://statsapi.web.nhl.com"; 56 | 57 | $date = Carbon::today(); 58 | $date->addDays($offset); 59 | $date->timezone('America/Toronto'); 60 | $daysProcessed = 0; 61 | 62 | $progress = new ProgressBar($this->output); 63 | $progress->start($days); 64 | 65 | while ($daysProcessed < $days) { 66 | $scoreboardURL = $urlRoot . "/api/v1/schedule?startDate=" . $date->format('Y-n-d') . "&endDate=" . $date->format('Y-n-d') . "&expand=schedule.teams,schedule.linescore,schedule.broadcasts.all,schedule.ticket,schedule.game.content.media.epg,schedule.radioBroadcasts,schedule.metadata,schedule.game.seriesSummary,seriesSummary.series&leaderCategories=&leaderGameTypes=R&site=en_nhlCA&teamId=&gameType=&timecode="; 67 | $this->output->writeln($scoreboardURL); 68 | $response = Curl::to($scoreboardURL)->get(); 69 | 70 | if ($response) { 71 | 72 | $scoreboard = json_decode($response, false); 73 | //var_dump($scoreboard); 74 | if (!empty($scoreboard->dates)) { 75 | 76 | foreach ($scoreboard->dates[0]->games as $game) { 77 | 78 | //die(); 79 | $homeTeam = Team::firstOrCreate([ 80 | 'team_code' => $game->teams->home->team->abbreviation, 81 | 'team_name' => ucwords(strtolower($game->teams->home->team->name)), 82 | ]); 83 | $awayTeam = Team::firstOrCreate([ 84 | 'team_code' => $game->teams->away->team->abbreviation, 85 | 'team_name' => ucwords(strtolower($game->teams->away->team->name)), 86 | ]); 87 | 88 | $startTime = Carbon::parse($game->gameDate); 89 | $curGame = Game::firstOrCreate([ 90 | 'game_code' => $game->gamePk, 91 | 'start_time' => $startTime->timestamp, 92 | ]); 93 | 94 | TeamService::assignTeamsToGame($curGame, [$homeTeam, $awayTeam]); 95 | } 96 | } 97 | } 98 | $date->addDay(); 99 | $daysProcessed++; 100 | $progress->advance(); 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /resources/views/auth/passwords/reset.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.main') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Reset Password
9 | 10 |
11 |
12 | {{ csrf_field() }} 13 | 14 | 15 | 16 |
17 | 18 | 19 |
20 | 21 | 22 | @if ($errors->has('email')) 23 | 24 | {{ $errors->first('email') }} 25 | 26 | @endif 27 |
28 |
29 | 30 |
31 | 32 | 33 |
34 | 35 | 36 | @if ($errors->has('password')) 37 | 38 | {{ $errors->first('password') }} 39 | 40 | @endif 41 |
42 |
43 | 44 |
45 | 46 |
47 | 48 | 49 | @if ($errors->has('password_confirmation')) 50 | 51 | {{ $errors->first('password_confirmation') }} 52 | 53 | @endif 54 |
55 |
56 | 57 |
58 |
59 | 62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 | @endsection 71 | -------------------------------------------------------------------------------- /config/auth.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'guard' => 'web', 18 | 'passwords' => 'users', 19 | ], 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Authentication Guards 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Next, you may define every authentication guard for your application. 27 | | Of course, a great default configuration has been defined for you 28 | | here which uses session storage and the Eloquent user provider. 29 | | 30 | | All authentication drivers have a user provider. This defines how the 31 | | users are actually retrieved out of your database or other storage 32 | | mechanisms used by this application to persist your user's data. 33 | | 34 | | Supported: "session", "token" 35 | | 36 | */ 37 | 38 | 'guards' => [ 39 | 'web' => [ 40 | 'driver' => 'session', 41 | 'provider' => 'users', 42 | ], 43 | 'admin' => [ 44 | 'driver' => 'session', 45 | 'provider' => 'users', 46 | ], 47 | 48 | 'api' => [ 49 | 'driver' => 'token', 50 | 'provider' => 'users', 51 | ], 52 | ], 53 | 54 | /* 55 | |-------------------------------------------------------------------------- 56 | | User Providers 57 | |-------------------------------------------------------------------------- 58 | | 59 | | All authentication drivers have a user provider. This defines how the 60 | | users are actually retrieved out of your database or other storage 61 | | mechanisms used by this application to persist your user's data. 62 | | 63 | | If you have multiple user tables or models you may configure multiple 64 | | sources which represent each model / table. These sources may then 65 | | be assigned to any extra authentication guards you have defined. 66 | | 67 | | Supported: "database", "eloquent" 68 | | 69 | */ 70 | 71 | 'providers' => [ 72 | 'users' => [ 73 | 'driver' => 'eloquent', 74 | 'model' => App\User::class, 75 | ], 76 | 77 | // 'users' => [ 78 | // 'driver' => 'database', 79 | // 'table' => 'users', 80 | // ], 81 | ], 82 | 83 | /* 84 | |-------------------------------------------------------------------------- 85 | | Resetting Passwords 86 | |-------------------------------------------------------------------------- 87 | | 88 | | Here you may set the options for resetting passwords including the view 89 | | that is your password reset e-mail. You may also set the name of the 90 | | table that maintains all of the reset tokens for your application. 91 | | 92 | | You may specify multiple password reset configurations if you have more 93 | | than one user table or model in the application and you want to have 94 | | separate password reset settings based on the specific user types. 95 | | 96 | | The expire time is the number of minutes that the reset token should be 97 | | considered valid. This security feature keeps tokens short-lived so 98 | | they have less time to be guessed. You may change this as needed. 99 | | 100 | */ 101 | 102 | 'passwords' => [ 103 | 'users' => [ 104 | 'provider' => 'users', 105 | 'table' => 'password_resets', 106 | 'expire' => 60, 107 | ], 108 | ], 109 | 110 | ]; 111 | -------------------------------------------------------------------------------- /resources/views/auth/register.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.main') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Register
9 |
10 |
11 | {{ csrf_field() }} 12 | 13 |
14 | 15 | 16 |
17 | 18 | 19 | @if ($errors->has('name')) 20 | 21 | {{ $errors->first('name') }} 22 | 23 | @endif 24 |
25 |
26 | 27 |
28 | 29 | 30 |
31 | 32 | 33 | @if ($errors->has('email')) 34 | 35 | {{ $errors->first('email') }} 36 | 37 | @endif 38 |
39 |
40 | 41 |
42 | 43 | 44 |
45 | 46 | 47 | @if ($errors->has('password')) 48 | 49 | {{ $errors->first('password') }} 50 | 51 | @endif 52 |
53 |
54 | 55 |
56 | 57 | 58 |
59 | 60 | 61 | @if ($errors->has('password_confirmation')) 62 | 63 | {{ $errors->first('password_confirmation') }} 64 | 65 | @endif 66 |
67 |
68 | 69 |
70 |
71 | 74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 | @endsection 83 | -------------------------------------------------------------------------------- /config/database.php: -------------------------------------------------------------------------------- 1 | PDO::FETCH_OBJ, 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Default Database Connection Name 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may specify which of the database connections below you wish 24 | | to use as your default connection for all database work. Of course 25 | | you may use many connections at once using the Database library. 26 | | 27 | */ 28 | 29 | 'default' => env('DB_CONNECTION', 'mysql'), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Database Connections 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here are each of the database connections setup for your application. 37 | | Of course, examples of configuring each database platform that is 38 | | supported by Laravel is shown below to make development simple. 39 | | 40 | | 41 | | All database work in Laravel is done through the PHP PDO facilities 42 | | so make sure you have the driver for your particular database of 43 | | choice installed on your machine before you begin development. 44 | | 45 | */ 46 | 47 | 'connections' => [ 48 | 49 | 'sqlite' => [ 50 | 'driver' => 'sqlite', 51 | 'database' => env('DB_DATABASE', database_path('database.sqlite')), 52 | 'prefix' => '', 53 | ], 54 | 55 | 'mysql' => [ 56 | 'driver' => 'mysql', 57 | 'host' => env('DB_HOST', 'localhost'), 58 | 'port' => env('DB_PORT', '3306'), 59 | 'database' => env('DB_DATABASE', 'forge'), 60 | 'username' => env('DB_USERNAME', 'forge'), 61 | 'password' => env('DB_PASSWORD', ''), 62 | 'charset' => 'utf8', 63 | 'collation' => 'utf8_unicode_ci', 64 | 'prefix' => '', 65 | 'strict' => true, 66 | 'engine' => null, 67 | ], 68 | 69 | 'pgsql' => [ 70 | 'driver' => 'pgsql', 71 | 'host' => env('DB_HOST', 'localhost'), 72 | 'port' => env('DB_PORT', '5432'), 73 | 'database' => env('DB_DATABASE', 'forge'), 74 | 'username' => env('DB_USERNAME', 'forge'), 75 | 'password' => env('DB_PASSWORD', ''), 76 | 'charset' => 'utf8', 77 | 'prefix' => '', 78 | 'schema' => 'public', 79 | 'sslmode' => 'prefer', 80 | ], 81 | 82 | ], 83 | 84 | /* 85 | |-------------------------------------------------------------------------- 86 | | Migration Repository Table 87 | |-------------------------------------------------------------------------- 88 | | 89 | | This table keeps track of all the migrations that have already run for 90 | | your application. Using this information, we can determine which of 91 | | the migrations on disk haven't actually been run in the database. 92 | | 93 | */ 94 | 95 | 'migrations' => 'migrations', 96 | 97 | /* 98 | |-------------------------------------------------------------------------- 99 | | Redis Databases 100 | |-------------------------------------------------------------------------- 101 | | 102 | | Redis is an open source, fast, and advanced key-value store that also 103 | | provides a richer set of commands than a typical key-value systems 104 | | such as APC or Memcached. Laravel makes it easy to dig right in. 105 | | 106 | */ 107 | 108 | 'redis' => [ 109 | 110 | 'cluster' => false, 111 | 112 | 'default' => [ 113 | 'host' => env('REDIS_HOST', 'localhost'), 114 | 'password' => env('REDIS_PASSWORD', null), 115 | 'port' => env('REDIS_PORT', 6379), 116 | 'database' => 0, 117 | ], 118 | 119 | ], 120 | 121 | ]; 122 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_DRIVER', 'smtp'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | SMTP Host Address 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may provide the host address of the SMTP server used by your 27 | | applications. A default option is provided that is compatible with 28 | | the Mailgun mail service which will provide reliable deliveries. 29 | | 30 | */ 31 | 32 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 33 | 34 | /* 35 | |-------------------------------------------------------------------------- 36 | | SMTP Host Port 37 | |-------------------------------------------------------------------------- 38 | | 39 | | This is the SMTP port used by your application to deliver e-mails to 40 | | users of the application. Like the host we have set this value to 41 | | stay compatible with the Mailgun e-mail application by default. 42 | | 43 | */ 44 | 45 | 'port' => env('MAIL_PORT', 587), 46 | 47 | /* 48 | |-------------------------------------------------------------------------- 49 | | Global "From" Address 50 | |-------------------------------------------------------------------------- 51 | | 52 | | You may wish for all e-mails sent by your application to be sent from 53 | | the same address. Here, you may specify a name and address that is 54 | | used globally for all e-mails that are sent by your application. 55 | | 56 | */ 57 | 58 | 'from' => [ 59 | 'address' => 'hello@example.com', 60 | 'name' => 'Example', 61 | ], 62 | 63 | /* 64 | |-------------------------------------------------------------------------- 65 | | E-Mail Encryption Protocol 66 | |-------------------------------------------------------------------------- 67 | | 68 | | Here you may specify the encryption protocol that should be used when 69 | | the application send e-mail messages. A sensible default using the 70 | | transport layer security protocol should provide great security. 71 | | 72 | */ 73 | 74 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 75 | 76 | /* 77 | |-------------------------------------------------------------------------- 78 | | SMTP Server Username 79 | |-------------------------------------------------------------------------- 80 | | 81 | | If your SMTP server requires a username for authentication, you should 82 | | set it here. This will get used to authenticate with your server on 83 | | connection. You may also set the "password" value below this one. 84 | | 85 | */ 86 | 87 | 'username' => env('MAIL_USERNAME'), 88 | 89 | /* 90 | |-------------------------------------------------------------------------- 91 | | SMTP Server Password 92 | |-------------------------------------------------------------------------- 93 | | 94 | | Here you may set the password required by your SMTP server to send out 95 | | messages from your application. This will be given to the server on 96 | | connection so that the application will be able to send messages. 97 | | 98 | */ 99 | 100 | 'password' => env('MAIL_PASSWORD'), 101 | 102 | /* 103 | |-------------------------------------------------------------------------- 104 | | Sendmail System Path 105 | |-------------------------------------------------------------------------- 106 | | 107 | | When using the "sendmail" driver to send e-mails, we will need to know 108 | | the path to where Sendmail lives on this server. A default path has 109 | | been provided here, which will work well on most of your systems. 110 | | 111 | */ 112 | 113 | 'sendmail' => '/usr/sbin/sendmail -bs', 114 | 115 | ]; 116 | -------------------------------------------------------------------------------- /resources/views/admin/layout/admin.blade.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 21 | {{----}} 98 | Goalfeed.ca - Trigger Philips Hue lights when your favourite NHL team scores 99 | 100 | 101 | 102 | 103 | 104 | 109 | 126 | 127 | 128 | 129 | @include('partials.header.header') 130 | 131 | @if ($showJumbo) 132 |
133 |
134 | @yield('jumbotron') 135 |
136 |
137 | @endif 138 | 139 | 140 |
141 | @yield('content') 142 |
143 | 144 | 147 |
148 | 149 | 150 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | -------------------------------------------------------------------------------- /resources/views/vendor/mail/html/themes/default.css: -------------------------------------------------------------------------------- 1 | /* Base */ 2 | 3 | body, body *:not(html):not(style):not(br):not(tr):not(code) { 4 | font-family: Avenir, Helvetica, sans-serif; 5 | box-sizing: border-box; 6 | } 7 | 8 | body { 9 | background-color: #f5f8fa; 10 | color: #74787E; 11 | height: 100%; 12 | hyphens: auto; 13 | line-height: 1.4; 14 | margin: 0; 15 | -moz-hyphens: auto; 16 | -ms-word-break: break-all; 17 | width: 100% !important; 18 | -webkit-hyphens: auto; 19 | -webkit-text-size-adjust: none; 20 | word-break: break-all; 21 | word-break: break-word; 22 | } 23 | 24 | p, 25 | ul, 26 | ol, 27 | blockquote { 28 | line-height: 1.4; 29 | text-align: left; 30 | } 31 | 32 | a { 33 | color: #3869D4; 34 | } 35 | 36 | a img { 37 | border: none; 38 | } 39 | 40 | /* Typography */ 41 | 42 | h1 { 43 | color: #2F3133; 44 | font-size: 19px; 45 | font-weight: bold; 46 | margin-top: 0; 47 | text-align: left; 48 | } 49 | 50 | h2 { 51 | color: #2F3133; 52 | font-size: 16px; 53 | font-weight: bold; 54 | margin-top: 0; 55 | text-align: left; 56 | } 57 | 58 | h3 { 59 | color: #2F3133; 60 | font-size: 14px; 61 | font-weight: bold; 62 | margin-top: 0; 63 | text-align: left; 64 | } 65 | 66 | p { 67 | color: #74787E; 68 | font-size: 16px; 69 | line-height: 1.5em; 70 | margin-top: 0; 71 | text-align: left; 72 | } 73 | 74 | p.sub { 75 | font-size: 12px; 76 | } 77 | 78 | img { 79 | max-width: 100%; 80 | } 81 | 82 | /* Layout */ 83 | 84 | .wrapper { 85 | background-color: #f5f8fa; 86 | margin: 0; 87 | padding: 0; 88 | width: 100%; 89 | -premailer-cellpadding: 0; 90 | -premailer-cellspacing: 0; 91 | -premailer-width: 100%; 92 | } 93 | 94 | .content { 95 | margin: 0; 96 | padding: 0; 97 | width: 100%; 98 | -premailer-cellpadding: 0; 99 | -premailer-cellspacing: 0; 100 | -premailer-width: 100%; 101 | } 102 | 103 | /* Header */ 104 | 105 | .header { 106 | padding: 25px 0; 107 | text-align: center; 108 | } 109 | 110 | .header a { 111 | color: #bbbfc3; 112 | font-size: 19px; 113 | font-weight: bold; 114 | text-decoration: none; 115 | text-shadow: 0 1px 0 white; 116 | } 117 | 118 | /* Body */ 119 | 120 | .body { 121 | background-color: #FFFFFF; 122 | border-bottom: 1px solid #EDEFF2; 123 | border-top: 1px solid #EDEFF2; 124 | margin: 0; 125 | padding: 0; 126 | width: 100%; 127 | -premailer-cellpadding: 0; 128 | -premailer-cellspacing: 0; 129 | -premailer-width: 100%; 130 | } 131 | 132 | .inner-body { 133 | background-color: #FFFFFF; 134 | margin: 0 auto; 135 | padding: 0; 136 | width: 570px; 137 | -premailer-cellpadding: 0; 138 | -premailer-cellspacing: 0; 139 | -premailer-width: 570px; 140 | } 141 | 142 | /* Subcopy */ 143 | 144 | .subcopy { 145 | border-top: 1px solid #EDEFF2; 146 | margin-top: 25px; 147 | padding-top: 25px; 148 | } 149 | 150 | .subcopy p { 151 | font-size: 12px; 152 | } 153 | 154 | /* Footer */ 155 | 156 | .footer { 157 | margin: 0 auto; 158 | padding: 0; 159 | text-align: center; 160 | width: 570px; 161 | -premailer-cellpadding: 0; 162 | -premailer-cellspacing: 0; 163 | -premailer-width: 570px; 164 | } 165 | 166 | .footer p { 167 | color: #AEAEAE; 168 | font-size: 12px; 169 | text-align: center; 170 | } 171 | 172 | /* Tables */ 173 | 174 | .table table { 175 | margin: 30px auto; 176 | width: 100%; 177 | -premailer-cellpadding: 0; 178 | -premailer-cellspacing: 0; 179 | -premailer-width: 100%; 180 | } 181 | 182 | .table th { 183 | border-bottom: 1px solid #EDEFF2; 184 | padding-bottom: 8px; 185 | } 186 | 187 | .table td { 188 | color: #74787E; 189 | font-size: 15px; 190 | line-height: 18px; 191 | padding: 10px 0; 192 | } 193 | 194 | .content-cell { 195 | padding: 35px; 196 | } 197 | 198 | /* Buttons */ 199 | 200 | .action { 201 | margin: 30px auto; 202 | padding: 0; 203 | text-align: center; 204 | width: 100%; 205 | -premailer-cellpadding: 0; 206 | -premailer-cellspacing: 0; 207 | -premailer-width: 100%; 208 | } 209 | 210 | .button { 211 | border-radius: 3px; 212 | box-shadow: 0 2px 3px rgba(0, 0, 0, 0.16); 213 | color: #FFF; 214 | display: inline-block; 215 | text-decoration: none; 216 | -webkit-text-size-adjust: none; 217 | } 218 | 219 | .button-blue { 220 | background-color: #3097D1; 221 | border-top: 10px solid #3097D1; 222 | border-right: 18px solid #3097D1; 223 | border-bottom: 10px solid #3097D1; 224 | border-left: 18px solid #3097D1; 225 | } 226 | 227 | .button-green { 228 | background-color: #2ab27b; 229 | border-top: 10px solid #2ab27b; 230 | border-right: 18px solid #2ab27b; 231 | border-bottom: 10px solid #2ab27b; 232 | border-left: 18px solid #2ab27b; 233 | } 234 | 235 | .button-red { 236 | background-color: #bf5329; 237 | border-top: 10px solid #bf5329; 238 | border-right: 18px solid #bf5329; 239 | border-bottom: 10px solid #bf5329; 240 | border-left: 18px solid #bf5329; 241 | } 242 | 243 | /* Panels */ 244 | 245 | .panel { 246 | margin: 0 0 21px; 247 | } 248 | 249 | .panel-content { 250 | background-color: #EDEFF2; 251 | padding: 16px; 252 | } 253 | 254 | .panel-item { 255 | padding: 0; 256 | } 257 | 258 | .panel-item p:last-of-type { 259 | margin-bottom: 0; 260 | padding-bottom: 0; 261 | } 262 | 263 | /* Promotions */ 264 | 265 | .promotion { 266 | background-color: #FFFFFF; 267 | border: 2px dashed #9BA2AB; 268 | margin: 0; 269 | margin-bottom: 25px; 270 | margin-top: 25px; 271 | padding: 24px; 272 | width: 100%; 273 | -premailer-cellpadding: 0; 274 | -premailer-cellspacing: 0; 275 | -premailer-width: 100%; 276 | } 277 | 278 | .promotion h1 { 279 | text-align: center; 280 | } 281 | 282 | .promotion p { 283 | font-size: 15px; 284 | text-align: center; 285 | } 286 | -------------------------------------------------------------------------------- /resources/lang/en/validation.php: -------------------------------------------------------------------------------- 1 | 'The :attribute must be accepted.', 17 | 'active_url' => 'The :attribute is not a valid URL.', 18 | 'after' => 'The :attribute must be a date after :date.', 19 | 'alpha' => 'The :attribute may only contain letters.', 20 | 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.', 21 | 'alpha_num' => 'The :attribute may only contain letters and numbers.', 22 | 'array' => 'The :attribute must be an array.', 23 | 'before' => 'The :attribute must be a date before :date.', 24 | 'between' => [ 25 | 'numeric' => 'The :attribute must be between :min and :max.', 26 | 'file' => 'The :attribute must be between :min and :max kilobytes.', 27 | 'string' => 'The :attribute must be between :min and :max characters.', 28 | 'array' => 'The :attribute must have between :min and :max items.', 29 | ], 30 | 'boolean' => 'The :attribute field must be true or false.', 31 | 'confirmed' => 'The :attribute confirmation does not match.', 32 | 'date' => 'The :attribute is not a valid date.', 33 | 'date_format' => 'The :attribute does not match the format :format.', 34 | 'different' => 'The :attribute and :other must be different.', 35 | 'digits' => 'The :attribute must be :digits digits.', 36 | 'digits_between' => 'The :attribute must be between :min and :max digits.', 37 | 'dimensions' => 'The :attribute has invalid image dimensions.', 38 | 'distinct' => 'The :attribute field has a duplicate value.', 39 | 'email' => 'The :attribute must be a valid email address.', 40 | 'exists' => 'The selected :attribute is invalid.', 41 | 'file' => 'The :attribute must be a file.', 42 | 'filled' => 'The :attribute field is required.', 43 | 'image' => 'The :attribute must be an image.', 44 | 'in' => 'The selected :attribute is invalid.', 45 | 'in_array' => 'The :attribute field does not exist in :other.', 46 | 'integer' => 'The :attribute must be an integer.', 47 | 'ip' => 'The :attribute must be a valid IP address.', 48 | 'json' => 'The :attribute must be a valid JSON string.', 49 | 'max' => [ 50 | 'numeric' => 'The :attribute may not be greater than :max.', 51 | 'file' => 'The :attribute may not be greater than :max kilobytes.', 52 | 'string' => 'The :attribute may not be greater than :max characters.', 53 | 'array' => 'The :attribute may not have more than :max items.', 54 | ], 55 | 'mimes' => 'The :attribute must be a file of type: :values.', 56 | 'min' => [ 57 | 'numeric' => 'The :attribute must be at least :min.', 58 | 'file' => 'The :attribute must be at least :min kilobytes.', 59 | 'string' => 'The :attribute must be at least :min characters.', 60 | 'array' => 'The :attribute must have at least :min items.', 61 | ], 62 | 'not_in' => 'The selected :attribute is invalid.', 63 | 'numeric' => 'The :attribute must be a number.', 64 | 'present' => 'The :attribute field must be present.', 65 | 'regex' => 'The :attribute format is invalid.', 66 | 'required' => 'The :attribute field is required.', 67 | 'required_if' => 'The :attribute field is required when :other is :value.', 68 | 'required_unless' => 'The :attribute field is required unless :other is in :values.', 69 | 'required_with' => 'The :attribute field is required when :values is present.', 70 | 'required_with_all' => 'The :attribute field is required when :values is present.', 71 | 'required_without' => 'The :attribute field is required when :values is not present.', 72 | 'required_without_all' => 'The :attribute field is required when none of :values are present.', 73 | 'same' => 'The :attribute and :other must match.', 74 | 'size' => [ 75 | 'numeric' => 'The :attribute must be :size.', 76 | 'file' => 'The :attribute must be :size kilobytes.', 77 | 'string' => 'The :attribute must be :size characters.', 78 | 'array' => 'The :attribute must contain :size items.', 79 | ], 80 | 'string' => 'The :attribute must be a string.', 81 | 'timezone' => 'The :attribute must be a valid zone.', 82 | 'unique' => 'The :attribute has already been taken.', 83 | 'url' => 'The :attribute format is invalid.', 84 | 85 | /* 86 | |-------------------------------------------------------------------------- 87 | | Custom Validation Language Lines 88 | |-------------------------------------------------------------------------- 89 | | 90 | | Here you may specify custom validation messages for attributes using the 91 | | convention "attribute.rule" to name the lines. This makes it quick to 92 | | specify a specific custom language line for a given attribute rule. 93 | | 94 | */ 95 | 96 | 'custom' => [ 97 | 'attribute-name' => [ 98 | 'rule-name' => 'custom-message', 99 | ], 100 | ], 101 | 102 | /* 103 | |-------------------------------------------------------------------------- 104 | | Custom Validation Attributes 105 | |-------------------------------------------------------------------------- 106 | | 107 | | The following language lines are used to swap attribute place-holders 108 | | with something more reader friendly such as E-Mail Address instead 109 | | of "email". This simply helps us make messages a little cleaner. 110 | | 111 | */ 112 | 113 | 'attributes' => [], 114 | 115 | ]; 116 | -------------------------------------------------------------------------------- /app/Console/Commands/GameListener.php: -------------------------------------------------------------------------------- 1 | output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); 68 | 69 | $this->cooldownCounter = self::COOLDOWN_TIME; 70 | $this->game = Game::whereGameCode($this->argument("game_code"))->first(); 71 | $gameUrl = 'http://live.nhle.com/GameData/20172018/' . $this->game->game_code . '/gc/gcsb.jsonp'; 72 | $gameActive = false; 73 | 74 | $this->game->listener_status = Game::GAME_LISTENER_STATUS_WAITING; 75 | $this->game->save(); 76 | 77 | $this->date = Carbon::createFromTimestamp($this->game->start_time, 'America/Toronto'); 78 | 79 | try { 80 | 81 | while ($gameActive == false) { 82 | //don't flood nhl with requests before the game is about to start 83 | if (time() >= $this->game->start_time - 90) { 84 | $this->game->listener_status = Game::GAME_LISTENER_STATUS_ACTIVE; 85 | $this->game->save(); 86 | $gameActive = true; 87 | } else { 88 | sleep(60); 89 | } 90 | } 91 | 92 | while ($gameActive == true) { 93 | 94 | $response = Curl::to($gameUrl)->get(); 95 | 96 | if ($response) { 97 | $scoreboard = EngineMiscFunctions::jsonp_decode($response); 98 | 99 | if ($scoreboard) { 100 | if ($this->homeTeamGoals === false || $this->awayTeamGoals === false) { 101 | $this->homeTeam = Team::whereTeamCode($scoreboard->h->ab)->first(); 102 | $this->awayTeam = Team::whereTeamCode($scoreboard->a->ab)->first(); 103 | 104 | $this->output->writeln("Game started"); 105 | $this->homeTeamGoals = $scoreboard->h->tot->g; 106 | $this->awayTeamGoals = $scoreboard->a->tot->g; 107 | } 108 | 109 | $this->checkForGoals($scoreboard); 110 | 111 | if (($scoreboard->p > 2 && $scoreboard->sr == 0) && ($this->game->start_time + self::LIVE_TIME <= time())) { 112 | $gameActive = !$this->isGameOver(); 113 | } 114 | sleep(1); 115 | } 116 | } 117 | } 118 | } catch (Exception $e) { 119 | Bugsnag::notifyError('Game Listener Exception', 'A game listener failed'); 120 | $this->game->listener_status = Game::GAME_LISTENER_STATUS_IDLE; 121 | $this->game->save(); 122 | } 123 | 124 | $this->game->listener_status = Game::GAME_LISTENER_STATUS_DONE; 125 | $this->game->save(); 126 | } 127 | 128 | public function checkForGoals($scoreboard) 129 | { 130 | 131 | if ($scoreboard) { 132 | if ($scoreboard->h->tot->g > $this->homeTeamGoals) { 133 | $this->goal($this->homeTeam); 134 | $this->homeTeamGoals = $scoreboard->h->tot->g; 135 | } 136 | 137 | if ($scoreboard->a->tot->g > $this->awayTeamGoals) { 138 | $this->goal($this->awayTeam); 139 | $this->awayTeamGoals = $scoreboard->a->tot->g; 140 | } 141 | } 142 | } 143 | 144 | public function goal(Team $team) 145 | { 146 | 147 | $teamname = $team->team_name; 148 | $this->output->writeln("Goal $teamname"); 149 | $message = new Message($team->team_code); 150 | dispatch(new MessageSender($message)); 151 | } 152 | 153 | public function isGameOver() 154 | { 155 | 156 | $gameIsOver = false; 157 | if ($this->cooldownCounter > 0) { 158 | 159 | $urlRoot = "https://statsapi.web.nhl.com"; 160 | $scoreboardURL = $urlRoot . "/api/v1/schedule?startDate=" . $this->date->format('Y-n-d') . "&endDate=" . $this->date->format('Y-n-d') . "&expand=schedule.teams,schedule.linescore,schedule.broadcasts.all,schedule.game.content.media.epg&leaderCategories=&leaderGameTypes=R&site=en_nhlCA&teamId=&gameType=&timecode="; 161 | $response = Curl::to($scoreboardURL)->get(); 162 | 163 | if ($response) { 164 | 165 | $scoreboard = json_decode($response, false); 166 | 167 | if ($scoreboard) { 168 | foreach ($scoreboard->dates[0]->games as $chkGame) { 169 | if ($chkGame->gamePk == $this->game->game_code && str_contains(strtolower($chkGame->status->detailedState), 170 | 'final')) { 171 | $this->output->writeln("Game over - cooling down - " . $this->cooldownCounter); 172 | $gameIsOver = true; 173 | } 174 | } 175 | } 176 | } 177 | 178 | if ($gameIsOver) { 179 | $this->cooldownCounter--; 180 | } else { 181 | $this->cooldownCounter = self::COOLDOWN_TIME; 182 | } 183 | 184 | return false; 185 | } else { 186 | return true; 187 | } 188 | } 189 | } 190 | -------------------------------------------------------------------------------- /config/ide-helper.php: -------------------------------------------------------------------------------- 1 | '_ide_helper', 15 | 'format' => 'php', 16 | 17 | /* 18 | |-------------------------------------------------------------------------- 19 | | Fluent helpers 20 | |-------------------------------------------------------------------------- 21 | | 22 | | Set to true to generate commonly used Fluent methods 23 | | 24 | */ 25 | 26 | 'include_fluent' => false, 27 | 28 | /* 29 | |-------------------------------------------------------------------------- 30 | | Write Model Magic methods 31 | |-------------------------------------------------------------------------- 32 | | 33 | | Set to false to disable write magic methods of model 34 | | 35 | */ 36 | 37 | 'write_model_magic_where' => true, 38 | 39 | /* 40 | |-------------------------------------------------------------------------- 41 | | Helper files to include 42 | |-------------------------------------------------------------------------- 43 | | 44 | | Include helper files. By default not included, but can be toggled with the 45 | | -- helpers (-H) option. Extra helper files can be included. 46 | | 47 | */ 48 | 49 | 'include_helpers' => false, 50 | 51 | 'helper_files' => array( 52 | base_path().'/vendor/laravel/framework/src/Illuminate/Support/helpers.php', 53 | ), 54 | 55 | /* 56 | |-------------------------------------------------------------------------- 57 | | Model locations to include 58 | |-------------------------------------------------------------------------- 59 | | 60 | | Define in which directories the ide-helper:models command should look 61 | | for models. 62 | | 63 | */ 64 | 65 | 'model_locations' => array( 66 | 'app', 67 | ), 68 | 69 | 70 | /* 71 | |-------------------------------------------------------------------------- 72 | | Extra classes 73 | |-------------------------------------------------------------------------- 74 | | 75 | | These implementations are not really extended, but called with magic functions 76 | | 77 | */ 78 | 79 | 'extra' => array( 80 | 'Eloquent' => array('Illuminate\Database\Eloquent\Builder', 'Illuminate\Database\Query\Builder'), 81 | 'Session' => array('Illuminate\Session\Store'), 82 | ), 83 | 84 | 'magic' => array( 85 | 'Log' => array( 86 | 'debug' => 'Monolog\Logger::addDebug', 87 | 'info' => 'Monolog\Logger::addInfo', 88 | 'notice' => 'Monolog\Logger::addNotice', 89 | 'warning' => 'Monolog\Logger::addWarning', 90 | 'error' => 'Monolog\Logger::addError', 91 | 'critical' => 'Monolog\Logger::addCritical', 92 | 'alert' => 'Monolog\Logger::addAlert', 93 | 'emergency' => 'Monolog\Logger::addEmergency', 94 | ) 95 | ), 96 | 97 | /* 98 | |-------------------------------------------------------------------------- 99 | | Interface implementations 100 | |-------------------------------------------------------------------------- 101 | | 102 | | These interfaces will be replaced with the implementing class. Some interfaces 103 | | are detected by the helpers, others can be listed below. 104 | | 105 | */ 106 | 107 | 'interfaces' => array( 108 | 109 | ), 110 | 111 | /* 112 | |-------------------------------------------------------------------------- 113 | | Support for custom DB types 114 | |-------------------------------------------------------------------------- 115 | | 116 | | This setting allow you to map any custom database type (that you may have 117 | | created using CREATE TYPE statement or imported using database plugin 118 | | / extension to a Doctrine type. 119 | | 120 | | Each key in this array is a name of the Doctrine2 DBAL Platform. Currently valid names are: 121 | | 'postgresql', 'db2', 'drizzle', 'mysql', 'oracle', 'sqlanywhere', 'sqlite', 'mssql' 122 | | 123 | | This name is returned by getName() method of the specific Doctrine/DBAL/Platforms/AbstractPlatform descendant 124 | | 125 | | The value of the array is an array of type mappings. Key is the name of the custom type, 126 | | (for example, "jsonb" from Postgres 9.4) and the value is the name of the corresponding Doctrine2 type (in 127 | | our case it is 'json_array'. Doctrine types are listed here: 128 | | http://doctrine-dbal.readthedocs.org/en/latest/reference/types.html 129 | | 130 | | So to support jsonb in your models when working with Postgres, just add the following entry to the array below: 131 | | 132 | | "postgresql" => array( 133 | | "jsonb" => "json_array", 134 | | ), 135 | | 136 | */ 137 | 'custom_db_types' => array( 138 | 139 | ), 140 | 141 | /* 142 | |-------------------------------------------------------------------------- 143 | | Support for camel cased models 144 | |-------------------------------------------------------------------------- 145 | | 146 | | There are some Laravel packages (such as Eloquence) that allow for accessing 147 | | Eloquent model properties via camel case, instead of snake case. 148 | | 149 | | Enabling this option will support these packages by saving all model 150 | | properties as camel case, instead of snake case. 151 | | 152 | | For example, normally you would see this: 153 | | 154 | | * @property \Carbon\Carbon $created_at 155 | | * @property \Carbon\Carbon $updated_at 156 | | 157 | | With this enabled, the properties will be this: 158 | | 159 | | * @property \Carbon\Carbon $createdAt 160 | | * @property \Carbon\Carbon $updatedAt 161 | | 162 | | Note, it is currently an all-or-nothing option. 163 | | 164 | */ 165 | 'model_camel_case_properties' => false, 166 | 167 | /* 168 | |-------------------------------------------------------------------------- 169 | | Property Casts 170 | |-------------------------------------------------------------------------- 171 | | 172 | | Cast the given "real type" to the given "type". 173 | | 174 | */ 175 | 'type_overrides' => array( 176 | 'integer' => 'int', 177 | 'boolean' => 'bool', 178 | ), 179 | ); 180 | -------------------------------------------------------------------------------- /config/session.php: -------------------------------------------------------------------------------- 1 | env('SESSION_DRIVER', 'file'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Session Lifetime 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may specify the number of minutes that you wish the session 27 | | to be allowed to remain idle before it expires. If you want them 28 | | to immediately expire on the browser closing, set that option. 29 | | 30 | */ 31 | 32 | 'lifetime' => 120, 33 | 34 | 'expire_on_close' => false, 35 | 36 | /* 37 | |-------------------------------------------------------------------------- 38 | | Session Encryption 39 | |-------------------------------------------------------------------------- 40 | | 41 | | This option allows you to easily specify that all of your session data 42 | | should be encrypted before it is stored. All encryption will be run 43 | | automatically by Laravel and you can use the Session like normal. 44 | | 45 | */ 46 | 47 | 'encrypt' => false, 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | Session File Location 52 | |-------------------------------------------------------------------------- 53 | | 54 | | When using the native session driver, we need a location where session 55 | | files may be stored. A default has been set for you but a different 56 | | location may be specified. This is only needed for file sessions. 57 | | 58 | */ 59 | 60 | 'files' => storage_path('framework/sessions'), 61 | 62 | /* 63 | |-------------------------------------------------------------------------- 64 | | Session Database Connection 65 | |-------------------------------------------------------------------------- 66 | | 67 | | When using the "database" or "redis" session drivers, you may specify a 68 | | connection that should be used to manage these sessions. This should 69 | | correspond to a connection in your database configuration options. 70 | | 71 | */ 72 | 73 | 'connection' => null, 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Session Database Table 78 | |-------------------------------------------------------------------------- 79 | | 80 | | When using the "database" session driver, you may specify the table we 81 | | should use to manage the sessions. Of course, a sensible default is 82 | | provided for you; however, you are free to change this as needed. 83 | | 84 | */ 85 | 86 | 'table' => 'sessions', 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | Session Cache Store 91 | |-------------------------------------------------------------------------- 92 | | 93 | | When using the "apc" or "memcached" session drivers, you may specify a 94 | | cache store that should be used for these sessions. This value must 95 | | correspond with one of the application's configured cache stores. 96 | | 97 | */ 98 | 99 | 'store' => null, 100 | 101 | /* 102 | |-------------------------------------------------------------------------- 103 | | Session Sweeping Lottery 104 | |-------------------------------------------------------------------------- 105 | | 106 | | Some session drivers must manually sweep their storage location to get 107 | | rid of old sessions from storage. Here are the chances that it will 108 | | happen on a given request. By default, the odds are 2 out of 100. 109 | | 110 | */ 111 | 112 | 'lottery' => [2, 100], 113 | 114 | /* 115 | |-------------------------------------------------------------------------- 116 | | Session Cookie Name 117 | |-------------------------------------------------------------------------- 118 | | 119 | | Here you may change the name of the cookie used to identify a session 120 | | instance by ID. The name specified here will get used every time a 121 | | new session cookie is created by the framework for every driver. 122 | | 123 | */ 124 | 125 | 'cookie' => 'laravel_session', 126 | 127 | /* 128 | |-------------------------------------------------------------------------- 129 | | Session Cookie Path 130 | |-------------------------------------------------------------------------- 131 | | 132 | | The session cookie path determines the path for which the cookie will 133 | | be regarded as available. Typically, this will be the root path of 134 | | your application but you are free to change this when necessary. 135 | | 136 | */ 137 | 138 | 'path' => '/', 139 | 140 | /* 141 | |-------------------------------------------------------------------------- 142 | | Session Cookie Domain 143 | |-------------------------------------------------------------------------- 144 | | 145 | | Here you may change the domain of the cookie used to identify a session 146 | | in your application. This will determine which domains the cookie is 147 | | available to in your application. A sensible default has been set. 148 | | 149 | */ 150 | 151 | 'domain' => env('SESSION_DOMAIN', null), 152 | 153 | /* 154 | |-------------------------------------------------------------------------- 155 | | HTTPS Only Cookies 156 | |-------------------------------------------------------------------------- 157 | | 158 | | By setting this option to true, session cookies will only be sent back 159 | | to the server if the browser has a HTTPS connection. This will keep 160 | | the cookie from being sent to you if it can not be done securely. 161 | | 162 | */ 163 | 164 | 'secure' => false, 165 | 166 | /* 167 | |-------------------------------------------------------------------------- 168 | | HTTP Access Only 169 | |-------------------------------------------------------------------------- 170 | | 171 | | Setting this value to true will prevent JavaScript from accessing the 172 | | value of the cookie and the cookie will only be accessible through 173 | | the HTTP protocol. You are free to modify this option if needed. 174 | | 175 | */ 176 | 177 | 'http_only' => true, 178 | 179 | ]; 180 | -------------------------------------------------------------------------------- /config/twigbridge.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | /** 13 | * Configuration options for Twig. 14 | */ 15 | return [ 16 | 17 | 'twig' => [ 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Extension 21 | |-------------------------------------------------------------------------- 22 | | 23 | | File extension for Twig view files. 24 | | 25 | */ 26 | 'extension' => 'twig', 27 | 28 | /* 29 | |-------------------------------------------------------------------------- 30 | | Accepts all Twig environment configuration options 31 | |-------------------------------------------------------------------------- 32 | | 33 | | http://twig.sensiolabs.org/doc/api.html#environment-options 34 | | 35 | */ 36 | 'environment' => [ 37 | 38 | // When set to true, the generated templates have a __toString() method 39 | // that you can use to display the generated nodes. 40 | // default: false 41 | 'debug' => env('APP_DEBUG', false), 42 | 43 | // The charset used by the templates. 44 | // default: utf-8 45 | 'charset' => 'utf-8', 46 | 47 | // The base template class to use for generated templates. 48 | // default: TwigBridge\Twig\Template 49 | 'base_template_class' => 'TwigBridge\Twig\Template', 50 | 51 | // An absolute path where to store the compiled templates, or false to disable caching. If null 52 | // then the cache file path is used. 53 | // default: cache file storage path 54 | 'cache' => null, 55 | 56 | // When developing with Twig, it's useful to recompile the template 57 | // whenever the source code changes. If you don't provide a value 58 | // for the auto_reload option, it will be determined automatically based on the debug value. 59 | 'auto_reload' => true, 60 | 61 | // If set to false, Twig will silently ignore invalid variables 62 | // (variables and or attributes/methods that do not exist) and 63 | // replace them with a null value. When set to true, Twig throws an exception instead. 64 | // default: false 65 | 'strict_variables' => false, 66 | 67 | // If set to true, auto-escaping will be enabled by default for all templates. 68 | // default: 'html' 69 | 'autoescape' => 'html', 70 | 71 | // A flag that indicates which optimizations to apply 72 | // (default to -1 -- all optimizations are enabled; set it to 0 to disable) 73 | 'optimizations' => -1, 74 | ], 75 | 76 | /* 77 | |-------------------------------------------------------------------------- 78 | | Global variables 79 | |-------------------------------------------------------------------------- 80 | | 81 | | These will always be passed in and can be accessed as Twig variables. 82 | | NOTE: these will be overwritten if you pass data into the view with the same key. 83 | | 84 | */ 85 | 'globals' => [], 86 | ], 87 | 88 | 'extensions' => [ 89 | 90 | /* 91 | |-------------------------------------------------------------------------- 92 | | Extensions 93 | |-------------------------------------------------------------------------- 94 | | 95 | | Enabled extensions. 96 | | 97 | | `Twig_Extension_Debug` is enabled automatically if twig.debug is TRUE. 98 | | 99 | */ 100 | 'enabled' => [ 101 | 'TwigBridge\Extension\Loader\Facades', 102 | 'TwigBridge\Extension\Loader\Filters', 103 | 'TwigBridge\Extension\Loader\Functions', 104 | 105 | 'TwigBridge\Extension\Laravel\Auth', 106 | 'TwigBridge\Extension\Laravel\Config', 107 | 'TwigBridge\Extension\Laravel\Dump', 108 | 'TwigBridge\Extension\Laravel\Input', 109 | 'TwigBridge\Extension\Laravel\Session', 110 | 'TwigBridge\Extension\Laravel\Str', 111 | 'TwigBridge\Extension\Laravel\Translator', 112 | 'TwigBridge\Extension\Laravel\Url', 113 | // 'TwigBridge\Extension\Laravel\Gate', 114 | 115 | // 'TwigBridge\Extension\Laravel\Form', 116 | // 'TwigBridge\Extension\Laravel\Html', 117 | // 'TwigBridge\Extension\Laravel\Legacy\Facades', 118 | ], 119 | 120 | /* 121 | |-------------------------------------------------------------------------- 122 | | Facades 123 | |-------------------------------------------------------------------------- 124 | | 125 | | Available facades. Access like `{{ Config.get('foo.bar') }}`. 126 | | 127 | | Each facade can take an optional array of options. To mark the whole facade 128 | | as safe you can set the option `'is_safe' => true`. Setting the facade as 129 | | safe means that any HTML returned will not be escaped. 130 | | 131 | | It is advisable to not set the whole facade as safe and instead mark the 132 | | each appropriate method as safe for security reasons. You can do that with 133 | | the following syntax: 134 | | 135 | | 136 | | 'Form' => [ 137 | | 'is_safe' => [ 138 | | 'open' 139 | | ] 140 | | ] 141 | | 142 | | 143 | | The values of the `is_safe` array must match the called method on the facade 144 | | in order to be marked as safe. 145 | | 146 | */ 147 | 'facades' => [], 148 | 149 | /* 150 | |-------------------------------------------------------------------------- 151 | | Functions 152 | |-------------------------------------------------------------------------- 153 | | 154 | | Available functions. Access like `{{ secure_url(...) }}`. 155 | | 156 | | Each function can take an optional array of options. These options are 157 | | passed directly to `Twig_SimpleFunction`. 158 | | 159 | | So for example, to mark a function as safe you can do the following: 160 | | 161 | | 162 | | 'link_to' => [ 163 | | 'is_safe' => ['html'] 164 | | ] 165 | | 166 | | 167 | | The options array also takes a `callback` that allows you to name the 168 | | function differently in your Twig templates than what it's actually called. 169 | | 170 | | 171 | | 'link' => [ 172 | | 'callback' => 'link_to' 173 | | ] 174 | | 175 | | 176 | */ 177 | 'functions' => [ 178 | 'elixir', 179 | 'head', 180 | 'last', 181 | 'mix', 182 | ], 183 | 184 | /* 185 | |-------------------------------------------------------------------------- 186 | | Filters 187 | |-------------------------------------------------------------------------- 188 | | 189 | | Available filters. Access like `{{ variable|filter }}`. 190 | | 191 | | Each filter can take an optional array of options. These options are 192 | | passed directly to `Twig_SimpleFilter`. 193 | | 194 | | So for example, to mark a filter as safe you can do the following: 195 | | 196 | | 197 | | 'studly_case' => [ 198 | | 'is_safe' => ['html'] 199 | | ] 200 | | 201 | | 202 | | The options array also takes a `callback` that allows you to name the 203 | | filter differently in your Twig templates than what is actually called. 204 | | 205 | | 206 | | 'snake' => [ 207 | | 'callback' => 'snake_case' 208 | | ] 209 | | 210 | | 211 | */ 212 | 'filters' => [ 213 | 'get' => 'data_get', 214 | ], 215 | ], 216 | ]; 217 | -------------------------------------------------------------------------------- /config/bugsnag.php: -------------------------------------------------------------------------------- 1 | env('BUGSNAG_API_KEY', ''), 18 | 19 | /* 20 | |-------------------------------------------------------------------------- 21 | | App Type 22 | |-------------------------------------------------------------------------- 23 | | 24 | | Set the type of application executing the current code. 25 | | 26 | */ 27 | 28 | 'app_type' => env('BUGSNAG_APP_TYPE'), 29 | 30 | /* 31 | |-------------------------------------------------------------------------- 32 | | App Version 33 | |-------------------------------------------------------------------------- 34 | | 35 | | Set the version of application executing the current code. 36 | | 37 | */ 38 | 39 | 'app_version' => env('BUGSNAG_APP_VERSION'), 40 | 41 | /* 42 | |-------------------------------------------------------------------------- 43 | | Batch Sending 44 | |-------------------------------------------------------------------------- 45 | | 46 | | Set to true to send the errors through to Bugsnag when the PHP process 47 | | shuts down, in order to prevent your app waiting on HTTP requests. 48 | | 49 | | Setting this to false will mean the we send an HTTP request straight away 50 | | for each error. 51 | | 52 | */ 53 | 54 | 'batch_sending' => env('BUGSNAG_BATCH_SENDING'), 55 | 56 | /* 57 | |-------------------------------------------------------------------------- 58 | | Endpoint 59 | |-------------------------------------------------------------------------- 60 | | 61 | | Set what server the Bugsnag notifier should send errors to. By default 62 | | this is set to 'https://notify.bugsnag.com', but for Bugsnag Enterprise 63 | | this should be the URL to your Bugsnag instance. 64 | | 65 | */ 66 | 67 | 'endpoint' => env('BUGSNAG_ENDPOINT'), 68 | 69 | /* 70 | |-------------------------------------------------------------------------- 71 | | Filters 72 | |-------------------------------------------------------------------------- 73 | | 74 | | Use this if you want to ensure you don't send sensitive data such as 75 | | passwords, and credit card numbers to our servers. Any keys which 76 | | contain these strings will be filtered. 77 | | 78 | */ 79 | 80 | 'filters' => empty(env('BUGSNAG_FILTERS')) ? ['password'] : explode(',', str_replace(' ', '', env('BUGSNAG_FILTERS'))), 81 | 82 | /* 83 | |-------------------------------------------------------------------------- 84 | | Hostname 85 | |-------------------------------------------------------------------------- 86 | | 87 | | You can set the hostname of your server to something specific for you to 88 | | identify it by if needed. 89 | | 90 | */ 91 | 92 | 'hostname' => env('BUGSNAG_HOSTNAME'), 93 | 94 | /* 95 | |-------------------------------------------------------------------------- 96 | | Proxy 97 | |-------------------------------------------------------------------------- 98 | | 99 | | This is where you can set the proxy settings you'd like us to use when 100 | | communicating with Bugsnag when reporting errors. 101 | | 102 | */ 103 | 104 | 'proxy' => array_filter([ 105 | 'http' => env('HTTP_PROXY'), 106 | 'https' => env('HTTPS_PROXY'), 107 | 'no' => empty(env('NO_PROXY')) ? null : explode(',', str_replace(' ', '', env('NO_PROXY'))), 108 | ]), 109 | 110 | /* 111 | |-------------------------------------------------------------------------- 112 | | Project Root 113 | |-------------------------------------------------------------------------- 114 | | 115 | | Bugsnag marks stacktrace lines as in-project if they come from files 116 | | inside your “project root”. You can set this here. 117 | | 118 | | If this is not set, we will automatically try to detect it. 119 | | 120 | */ 121 | 122 | 'project_root' => env('BUGSNAG_PROJECT_ROOT'), 123 | 124 | /* 125 | |-------------------------------------------------------------------------- 126 | | Strip Path 127 | |-------------------------------------------------------------------------- 128 | | 129 | | You can set a strip path to have it also trimmed from the start of any 130 | | filepath in your stacktraces. 131 | | 132 | | If this is not set, we will automatically try to detect it. 133 | | 134 | */ 135 | 136 | 'strip_path' => env('BUGSNAG_STRIP_PATH'), 137 | 138 | /* 139 | |-------------------------------------------------------------------------- 140 | | Query 141 | |-------------------------------------------------------------------------- 142 | | 143 | | Enable this if you'd like us to automatically record all queries executed 144 | | as breadcrumbs. 145 | | 146 | */ 147 | 148 | 'query' => env('BUGSNAG_QUERY', true), 149 | 150 | /* 151 | |-------------------------------------------------------------------------- 152 | | Bindings 153 | |-------------------------------------------------------------------------- 154 | | 155 | | Enable this if you'd like us to include the query bindings in our query 156 | | breadcrumbs. 157 | | 158 | */ 159 | 160 | 'bindings' => env('BUGSNAG_QUERY_BINDINGS', false), 161 | 162 | /* 163 | |-------------------------------------------------------------------------- 164 | | Release Stage 165 | |-------------------------------------------------------------------------- 166 | | 167 | | Set the release stage to use when sending notifications to Bugsnag. 168 | | 169 | | Leaving this unset will default to using the application environment. 170 | | 171 | */ 172 | 173 | 'release_stage' => env('BUGSNAG_RELEASE_STAGE'), 174 | 175 | /* 176 | |-------------------------------------------------------------------------- 177 | | Notify Release Stages 178 | |-------------------------------------------------------------------------- 179 | | 180 | | Set which release stages should send notifications to Bugsnag. 181 | | 182 | */ 183 | 184 | 'notify_release_stages' => empty(env('BUGSNAG_NOTIFY_RELEASE_STAGES')) ? null : explode(',', str_replace(' ', '', env('BUGSNAG_NOTIFY_RELEASE_STAGES'))), 185 | 186 | /* 187 | |-------------------------------------------------------------------------- 188 | | Send Code 189 | |-------------------------------------------------------------------------- 190 | | 191 | | Bugsnag automatically sends a small snippet of the code that crashed to 192 | | help you diagnose even faster from within your dashboard. If you don’t 193 | | want to send this snippet, then set this to false. 194 | | 195 | */ 196 | 197 | 'send_code' => env('BUGSNAG_SEND_CODE', true), 198 | 199 | /* 200 | |-------------------------------------------------------------------------- 201 | | Callbacks 202 | |-------------------------------------------------------------------------- 203 | | 204 | | Enable this if you'd like us to enable our default set of notification 205 | | callbacks. These add things like the cookie information and session 206 | | details to the error to be sent to Bugsnag. 207 | | 208 | | If you'd like to add your own callbacks, you can call the 209 | | Bugsnag::registerCallback method from the boot method of your app 210 | | service provider. 211 | | 212 | */ 213 | 214 | 'callbacks' => env('BUGSNAG_CALLBACKS', true), 215 | 216 | /* 217 | |-------------------------------------------------------------------------- 218 | | User 219 | |-------------------------------------------------------------------------- 220 | | 221 | | Enable this if you'd like us to set the current user logged in via 222 | | Laravel's authentication system. 223 | | 224 | | If you'd like to add your own user resolver, you can do this by using 225 | | callbacks via Bugsnag::registerCallback. 226 | | 227 | */ 228 | 229 | 'user' => env('BUGSNAG_USER', true), 230 | 231 | ]; 232 | -------------------------------------------------------------------------------- /config/app.php: -------------------------------------------------------------------------------- 1 | 'My Application', 16 | 17 | /* 18 | |-------------------------------------------------------------------------- 19 | | Application Environment 20 | |-------------------------------------------------------------------------- 21 | | 22 | | This value determines the "environment" your application is currently 23 | | running in. This may determine how you prefer to configure various 24 | | services your application utilizes. Set this in your ".env" file. 25 | | 26 | */ 27 | 28 | 'env' => env('APP_ENV', 'production'), 29 | 30 | /* 31 | |-------------------------------------------------------------------------- 32 | | Application Debug Mode 33 | |-------------------------------------------------------------------------- 34 | | 35 | | When your application is in debug mode, detailed error messages with 36 | | stack traces will be shown on every error that occurs within your 37 | | application. If disabled, a simple generic error page is shown. 38 | | 39 | */ 40 | 41 | 'debug' => env('APP_DEBUG', false), 42 | 43 | /* 44 | |-------------------------------------------------------------------------- 45 | | Application URL 46 | |-------------------------------------------------------------------------- 47 | | 48 | | This URL is used by the console to properly generate URLs when using 49 | | the Artisan command line tool. You should set this to the root of 50 | | your application so that it is used when running Artisan tasks. 51 | | 52 | */ 53 | 54 | 'url' => env('APP_URL', 'http://goalfeed.ca'), 55 | 56 | /* 57 | |-------------------------------------------------------------------------- 58 | | Application Timezone 59 | |-------------------------------------------------------------------------- 60 | | 61 | | Here you may specify the default timezone for your application, which 62 | | will be used by the PHP date and date-time functions. We have gone 63 | | ahead and set this to a sensible default for you out of the box. 64 | | 65 | */ 66 | 67 | 'timezone' => 'UTC', 68 | 69 | /* 70 | |-------------------------------------------------------------------------- 71 | | Application Locale Configuration 72 | |-------------------------------------------------------------------------- 73 | | 74 | | The application locale determines the default locale that will be used 75 | | by the translation service provider. You are free to set this value 76 | | to any of the locales which will be supported by the application. 77 | | 78 | */ 79 | 80 | 'locale' => 'en', 81 | 82 | /* 83 | |-------------------------------------------------------------------------- 84 | | Application Fallback Locale 85 | |-------------------------------------------------------------------------- 86 | | 87 | | The fallback locale determines the locale to use when the current one 88 | | is not available. You may change the value to correspond to any of 89 | | the language folders that are provided through your application. 90 | | 91 | */ 92 | 93 | 'fallback_locale' => 'en', 94 | 95 | /* 96 | |-------------------------------------------------------------------------- 97 | | Encryption Key 98 | |-------------------------------------------------------------------------- 99 | | 100 | | This key is used by the Illuminate encrypter service and should be set 101 | | to a random, 32 character string, otherwise these encrypted strings 102 | | will not be safe. Please do this before deploying an application! 103 | | 104 | */ 105 | 106 | 'key' => env('APP_KEY'), 107 | 108 | 'cipher' => 'AES-256-CBC', 109 | 110 | /* 111 | |-------------------------------------------------------------------------- 112 | | Logging Configuration 113 | |-------------------------------------------------------------------------- 114 | | 115 | | Here you may configure the log settings for your application. Out of 116 | | the box, Laravel uses the Monolog PHP logging library. This gives 117 | | you a variety of powerful log handlers / formatters to utilize. 118 | | 119 | | Available Settings: "single", "daily", "syslog", "errorlog" 120 | | 121 | */ 122 | 123 | 'log' => env('APP_LOG', 'single'), 124 | 125 | 'log_level' => env('APP_LOG_LEVEL', 'debug'), 126 | 127 | /* 128 | |-------------------------------------------------------------------------- 129 | | Autoloaded Service Providers 130 | |-------------------------------------------------------------------------- 131 | | 132 | | The service providers listed here will be automatically loaded on the 133 | | request to your application. Feel free to add your own services to 134 | | this array to grant expanded functionality to your applications. 135 | | 136 | */ 137 | 138 | 'providers' => [ 139 | 140 | /* 141 | * Laravel Framework Service Providers... 142 | */ 143 | Illuminate\Auth\AuthServiceProvider::class, 144 | Illuminate\Broadcasting\BroadcastServiceProvider::class, 145 | Illuminate\Bus\BusServiceProvider::class, 146 | Illuminate\Cache\CacheServiceProvider::class, 147 | Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, 148 | Illuminate\Cookie\CookieServiceProvider::class, 149 | Illuminate\Database\DatabaseServiceProvider::class, 150 | Illuminate\Encryption\EncryptionServiceProvider::class, 151 | Illuminate\Filesystem\FilesystemServiceProvider::class, 152 | Illuminate\Foundation\Providers\FoundationServiceProvider::class, 153 | Illuminate\Hashing\HashServiceProvider::class, 154 | Illuminate\Mail\MailServiceProvider::class, 155 | Illuminate\Notifications\NotificationServiceProvider::class, 156 | Illuminate\Pagination\PaginationServiceProvider::class, 157 | Illuminate\Pipeline\PipelineServiceProvider::class, 158 | Illuminate\Queue\QueueServiceProvider::class, 159 | Illuminate\Redis\RedisServiceProvider::class, 160 | Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, 161 | Illuminate\Session\SessionServiceProvider::class, 162 | Illuminate\Translation\TranslationServiceProvider::class, 163 | Illuminate\Validation\ValidationServiceProvider::class, 164 | Illuminate\View\ViewServiceProvider::class, 165 | Ixudra\Curl\CurlServiceProvider::class, 166 | 167 | /* 168 | * Package Service Providers... 169 | */ 170 | // 171 | Bugsnag\BugsnagLaravel\BugsnagServiceProvider::class, 172 | TwigBridge\ServiceProvider::class, 173 | 174 | 175 | /* 176 | * Application Service Providers... 177 | */ 178 | App\Providers\AppServiceProvider::class, 179 | App\Providers\BroadcastServiceProvider::class, 180 | App\Providers\AuthServiceProvider::class, 181 | App\Providers\EventServiceProvider::class, 182 | App\Providers\RouteServiceProvider::class, 183 | 184 | ], 185 | 186 | /* 187 | |-------------------------------------------------------------------------- 188 | | Class Aliases 189 | |-------------------------------------------------------------------------- 190 | | 191 | | This array of class aliases will be registered when this application 192 | | is started. However, feel free to register as many as you wish as 193 | | the aliases are "lazy" loaded so they don't hinder performance. 194 | | 195 | */ 196 | 197 | 'aliases' => [ 198 | 199 | 'App' => Illuminate\Support\Facades\App::class, 200 | 'Artisan' => Illuminate\Support\Facades\Artisan::class, 201 | 'Auth' => Illuminate\Support\Facades\Auth::class, 202 | 'Blade' => Illuminate\Support\Facades\Blade::class, 203 | 'Cache' => Illuminate\Support\Facades\Cache::class, 204 | 'Config' => Illuminate\Support\Facades\Config::class, 205 | 'Cookie' => Illuminate\Support\Facades\Cookie::class, 206 | 'Crypt' => Illuminate\Support\Facades\Crypt::class, 207 | 'DB' => Illuminate\Support\Facades\DB::class, 208 | 'Eloquent' => Illuminate\Database\Eloquent\Model::class, 209 | 'Event' => Illuminate\Support\Facades\Event::class, 210 | 'File' => Illuminate\Support\Facades\File::class, 211 | 'Gate' => Illuminate\Support\Facades\Gate::class, 212 | 'Hash' => Illuminate\Support\Facades\Hash::class, 213 | 'Lang' => Illuminate\Support\Facades\Lang::class, 214 | 'Log' => Illuminate\Support\Facades\Log::class, 215 | 'Mail' => Illuminate\Support\Facades\Mail::class, 216 | 'Notification' => Illuminate\Support\Facades\Notification::class, 217 | 'Password' => Illuminate\Support\Facades\Password::class, 218 | 'Queue' => Illuminate\Support\Facades\Queue::class, 219 | 'Redirect' => Illuminate\Support\Facades\Redirect::class, 220 | 'Redis' => Illuminate\Support\Facades\Redis::class, 221 | 'Request' => Illuminate\Support\Facades\Request::class, 222 | 'Response' => Illuminate\Support\Facades\Response::class, 223 | 'Route' => Illuminate\Support\Facades\Route::class, 224 | 'Schema' => Illuminate\Support\Facades\Schema::class, 225 | 'Session' => Illuminate\Support\Facades\Session::class, 226 | 'Storage' => Illuminate\Support\Facades\Storage::class, 227 | 'URL' => Illuminate\Support\Facades\URL::class, 228 | 'Validator' => Illuminate\Support\Facades\Validator::class, 229 | 'View' => Illuminate\Support\Facades\View::class, 230 | 'Curl' => Ixudra\Curl\Facades\Curl::class, 231 | 'Bugsnag' => Bugsnag\BugsnagLaravel\Facades\Bugsnag::class, 232 | 233 | ], 234 | 235 | ]; 236 | --------------------------------------------------------------------------------