├── .env.example
├── .env.testing
├── .gitattributes
├── .gitignore
├── .travis.yml
├── Homestead.yaml.example
├── LICENSE
├── Vagrantfile
├── app
├── Console
│ ├── Commands
│ │ └── SendDiscordMessage.php
│ └── Kernel.php
├── Exceptions
│ └── Handler.php
├── Http
│ ├── Controllers
│ │ ├── Api
│ │ │ ├── GamesController.php
│ │ │ ├── PlatformsController.php
│ │ │ ├── PostsController.php
│ │ │ ├── TeamsController.php
│ │ │ ├── TournamentsController.php
│ │ │ └── UsersController.php
│ │ ├── Auth
│ │ │ ├── ForgotPasswordController.php
│ │ │ ├── LoginController.php
│ │ │ ├── PasswordController.php
│ │ │ ├── RegisterController.php
│ │ │ └── ResetPasswordController.php
│ │ ├── Controller.php
│ │ └── Site
│ │ │ ├── HomeController.php
│ │ │ ├── PageController.php
│ │ │ ├── PlayerController.php
│ │ │ ├── ProfileController.php
│ │ │ ├── SettingsController.php
│ │ │ ├── TeamController.php
│ │ │ ├── TeamInvitesController.php
│ │ │ └── TournamentController.php
│ ├── Kernel.php
│ ├── Middleware
│ │ ├── EncryptCookies.php
│ │ ├── RedirectIfAuthenticated.php
│ │ └── VerifyCsrfToken.php
│ └── Requests
│ │ └── Request.php
├── Mail
│ └── AccountCreated.php
├── Models
│ ├── Game.php
│ ├── Platform.php
│ ├── Post.php
│ ├── Team.php
│ ├── TeamInvite.php
│ ├── Tournament.php
│ └── User.php
├── Notifications
│ ├── JoinedTournamentConfirmation.php
│ ├── ReceivedTeamInvitation.php
│ └── TournamentStarting.php
├── Providers
│ ├── AppServiceProvider.php
│ ├── AuthServiceProvider.php
│ ├── EventServiceProvider.php
│ └── RouteServiceProvider.php
├── Support
│ └── Helpers.php
└── Traits
│ ├── Teams
│ └── TeamTrait.php
│ └── Users
│ └── HasTeams.php
├── artisan
├── bootstrap
├── app.php
├── autoload.php
└── cache
│ └── .gitignore
├── composer.json
├── composer.lock
├── config
├── app.php
├── auth.php
├── broadcasting.php
├── cache.php
├── compile.php
├── database.php
├── filesystems.php
├── mail.php
├── queue.php
├── services.php
├── session.php
├── teamwork.php
└── view.php
├── database
├── .gitignore
├── factories
│ └── ModelFactory.php
├── migrations
│ ├── .gitkeep
│ ├── 2014_10_12_000000_create_users_table.php
│ ├── 2014_10_12_100000_create_password_resets_table.php
│ ├── 2016_05_25_043614_create_platforms_table.php
│ ├── 2016_05_25_043623_create_games_table.php
│ ├── 2016_05_25_184909_add_platform_game_table.php
│ ├── 2016_07_29_061330_create_posts_table.php
│ ├── 2016_08_18_021209_create_tournaments_table.php
│ └── 2016_08_18_062025_setup_team_tables.php
└── seeds
│ ├── .gitkeep
│ └── DatabaseSeeder.php
├── gulpfile.js
├── package.json
├── phpunit.xml
├── public
├── .htaccess
├── css
│ ├── app.css
│ └── app.css.map
├── favicon.ico
├── index.php
├── js
│ ├── admin
│ │ ├── 0.main.js
│ │ └── main.js
│ └── app.js
├── robots.txt
└── web.config
├── readme.md
├── resources
├── assets
│ ├── js
│ │ ├── admin
│ │ │ ├── components
│ │ │ │ ├── AdminHeader.vue
│ │ │ │ ├── App.vue
│ │ │ │ ├── Dashboard.vue
│ │ │ │ ├── GamesManager.vue
│ │ │ │ ├── OauthSettings.vue
│ │ │ │ ├── PlatformsManager.vue
│ │ │ │ ├── UsersManager.vue
│ │ │ │ └── passport
│ │ │ │ │ ├── AuthorizedClients.vue
│ │ │ │ │ ├── Clients.vue
│ │ │ │ │ └── PersonalAccessTokens.vue
│ │ │ └── main.js
│ │ ├── app.js
│ │ └── components
│ │ │ └── Auth.vue
│ └── sass
│ │ ├── admin
│ │ ├── _animate.scss
│ │ └── styles.scss
│ │ ├── app.scss
│ │ └── default
│ │ ├── _global.scss
│ │ ├── _header.scss
│ │ ├── _settings.scss
│ │ └── styles.scss
├── lang
│ └── en
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
└── views
│ ├── admin
│ └── index.blade.php
│ ├── auth
│ ├── emails
│ │ └── password.blade.php
│ ├── login.blade.php
│ ├── passwords
│ │ ├── email.blade.php
│ │ └── reset.blade.php
│ └── register.blade.php
│ ├── emails
│ └── accounts
│ │ └── created.blade.php
│ ├── errors
│ ├── 404.blade.php
│ └── 503.blade.php
│ ├── layouts
│ └── app.blade.php
│ └── site
│ ├── blog-view.blade.php
│ ├── blog.blade.php
│ ├── home.blade.php
│ ├── partials
│ └── news.blade.php
│ ├── player-view.blade.php
│ ├── players.blade.php
│ ├── shared
│ ├── footer.blade.php
│ └── header.blade.php
│ ├── team-view.blade.php
│ ├── teams.blade.php
│ ├── teams
│ ├── create.blade.php
│ ├── edit.blade.php
│ ├── index.blade.php
│ └── members.blade.php
│ ├── tournament-view.blade.php
│ └── tournaments.blade.php
├── routes
├── api.php
└── web.php
├── server.php
├── tests
├── TestCase.php
├── integration
│ └── Api
│ │ ├── GamesControllerTest.php
│ │ ├── PlatformControllerTest.php
│ │ ├── PostsControllerTest.php
│ │ ├── TeamsControllerTest.php
│ │ └── UsersControllerTest.php
└── unit
│ └── ControllerTest.php
└── webpack.config.js
/.env.example:
--------------------------------------------------------------------------------
1 | APP_NAME="Bracket"
2 | APP_ENV="local"
3 | APP_DEBUG=true
4 | APP_LOG_LEVEL="debug"
5 | APP_URL="http://bracket"
6 | APP_KEY=""
7 |
8 | DB_CONNECTION="mysql"
9 | DB_HOST="127.0.0.1"
10 | DB_PORT=3306
11 | DB_DATABASE="homestead"
12 | DB_USERNAME="homestead"
13 | DB_PASSWORD="secret"
14 |
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 | DISCORD_TOKEN=
31 | CHALLONGE_API=
32 |
33 | PUSHER_KEY=
34 | PUSHER_SECRET=
35 | PUSHER_APP_ID=
36 |
--------------------------------------------------------------------------------
/.env.testing:
--------------------------------------------------------------------------------
1 | APP_NAME="Bracket"
2 | APP_ENV="testing"
3 | APP_DEBUG=true
4 | APP_KEY="base64:8vzW7BLhdFrgS90PQDYR7WCN+lJ1RKvpvLndS5AXS18="
5 | APP_LOG_LEVEL="debug"
6 |
7 | DB_CONNECTION="sqlite"
8 | DB_DATABASE=":memory:"
9 |
10 | CACHE_DRIVER="file"
11 | SESSION_DRIVER="file"
12 | QUEUE_DRIVER="sync"
13 |
14 | REDIS_HOST="127.0.0.1"
15 | REDIS_PASSWORD=null
16 | REDIS_PORT=6379
17 |
18 | MAIL_DRIVER="smtp"
19 | MAIL_HOST="mailtrap.io"
20 | MAIL_PORT=2525
21 | MAIL_USERNAME=null
22 | MAIL_PASSWORD=null
23 | MAIL_ENCRYPTION=null
24 |
25 | PUSHER_KEY=
26 | PUSHER_SECRET=
27 | PUSHER_APP_ID=
28 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 | *.css linguist-vendored
3 | *.scss linguist-vendored
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by https://www.gitignore.io/api/laravel
2 |
3 | ### Homestead ###
4 | Homestead.yaml
5 |
6 | ### Laravel ###
7 | vendor/
8 | node_modules/
9 |
10 | # Laravel 4 specific
11 | bootstrap/compiled.php
12 | app/storage/
13 |
14 | # Laravel 5 & Lumen specific
15 | bootstrap/cache/
16 | storage/
17 | storage/framework/cache/*
18 | storage/framework/sessions/*
19 | storage/framework/views/*
20 | !storage/framework/cache/.gitkeep
21 | !storage/framework/sessions/.gitkeep
22 | !storage/framework/views/.gitkeep
23 |
24 | .vagrant/
25 | .env.*.php
26 | .env.php
27 | .env
28 |
29 | # Rocketeer PHP task runner and deployment package. https://github.com/rocketeers/rocketeer
30 | .rocketeer/
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: php
2 | php:
3 | - '5.6'
4 | - '7.0'
5 | before_script:
6 | - composer self-update
7 | install:
8 | - composer install --prefer-source --no-interaction --dev
9 |
--------------------------------------------------------------------------------
/Homestead.yaml.example:
--------------------------------------------------------------------------------
1 | ---
2 | ip: "192.168.10.10"
3 | memory: 1024
4 | cpus: 1
5 | hostname: bracket
6 | name: bracket
7 | provider: virtualbox
8 |
9 | authorize: ~/.ssh/id_rsa.pub
10 |
11 | keys:
12 | - ~/.ssh/id_rsa
13 |
14 | folders:
15 | - map: "/path/to/bracket"
16 | to: "/home/vagrant/bracket"
17 |
18 | sites:
19 | - map: homestead.app
20 | to: "/home/vagrant/bracket/public"
21 |
22 | databases:
23 | - homestead
24 |
25 | # blackfire:
26 | # - id: foo
27 | # token: bar
28 | # client-id: foo
29 | # client-token: bar
30 |
31 | # ports:
32 | # - send: 50000
33 | # to: 5000
34 | # - send: 7777
35 | # to: 777
36 | # protocol: udp
37 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 Joshua Kidd
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Vagrantfile:
--------------------------------------------------------------------------------
1 | require 'json'
2 | require 'yaml'
3 |
4 | VAGRANTFILE_API_VERSION ||= "2"
5 | confDir = $confDir ||= File.expand_path("vendor/laravel/homestead", File.dirname(__FILE__))
6 |
7 | homesteadYamlPath = "Homestead.yaml"
8 | homesteadJsonPath = "Homestead.json"
9 | afterScriptPath = "after.sh"
10 | aliasesPath = "aliases"
11 |
12 | require File.expand_path(confDir + '/scripts/homestead.rb')
13 |
14 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
15 | if File.exists? aliasesPath then
16 | config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases"
17 | end
18 |
19 | if File.exists? homesteadYamlPath then
20 | Homestead.configure(config, YAML::load(File.read(homesteadYamlPath)))
21 | elsif File.exists? homesteadJsonPath then
22 | Homestead.configure(config, JSON.parse(File.read(homesteadJsonPath)))
23 | end
24 |
25 | if File.exists? afterScriptPath then
26 | config.vm.provision "shell", path: afterScriptPath
27 | end
28 | end
29 |
--------------------------------------------------------------------------------
/app/Console/Commands/SendDiscordMessage.php:
--------------------------------------------------------------------------------
1 | argument('message');
43 |
44 | if(!config('services.discord.token')) {
45 | $this->error("You need to set the DISCORD_TOKEN in the .env file!");
46 | return false;
47 | }
48 |
49 | $discord = new Discord([
50 | 'token' => config('services.discord.token')
51 | ]);
52 |
53 | $discord->on('ready', function($discord) {
54 | $discord->updatePresence($discord->factory(Game::class, ['name' => "with your minds!"]), false);
55 | $guild = $discord->guilds->first();
56 |
57 | foreach($guild->channels->getAll('type', 'text') as $channel) {
58 | if($channel->name == "discord-tests") {
59 | $this->line($channel->name);
60 | $channel->sendMessage($this->argument('message'));
61 | }
62 | }
63 |
64 | $discord->close();
65 | return true;
66 | });
67 |
68 | $discord->run();
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/app/Console/Kernel.php:
--------------------------------------------------------------------------------
1 | command('inspire')
29 | // ->hourly();
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/Exceptions/Handler.php:
--------------------------------------------------------------------------------
1 | expectsJson()) {
59 | return response()->json(['error' => 'Unauthenticated.'], 401);
60 | } else {
61 | return redirect()->guest('login');
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Api/GamesController.php:
--------------------------------------------------------------------------------
1 | gameModel = $gameModel;
15 | }
16 |
17 | /**
18 | * Display a listing of the resource.
19 | *
20 | * @return \Illuminate\Http\Response
21 | */
22 | public function index()
23 | {
24 | $games = $this->gameModel->all();
25 |
26 | return response()->json($games->toArray());
27 | }
28 |
29 | /**
30 | * Store a newly created resource in storage.
31 | *
32 | * @param \Illuminate\Http\Request $request
33 | *
34 | * @return \Illuminate\Http\Response
35 | */
36 | public function store(Request $request)
37 | {
38 | $this->validate($request, [
39 | 'name' => 'required|max:255',
40 | 'short_name' => 'required|max:100'
41 | ]);
42 |
43 | $game = new $this->gameModel([
44 | 'name' => $request->input('name'),
45 | 'short_name' => $request->input('short_name'),
46 | 'slug' => str_slug($request->input('name')),
47 | 'logo' => '',
48 | 'banner' => ''
49 | ]);
50 |
51 | $game->save();
52 | $game->platforms()->attach($request->input('platforms'));
53 |
54 | return response()->json($game);
55 | }
56 |
57 | /**
58 | * Display the specified resource.
59 | *
60 | * @param int $id
61 | *
62 | * @return \Illuminate\Http\Response
63 | */
64 | public function show($id)
65 | {
66 | $game = $this->gameModel->find($id);
67 |
68 | if (!$game) {
69 | return $this->recordNotFound();
70 | }
71 |
72 | return response()->json($game);
73 | }
74 |
75 | /**
76 | * Update the specified resource in storage.
77 | *
78 | * @param \Illuminate\Http\Request $request
79 | * @param int $id
80 | *
81 | * @return \Illuminate\Http\Response
82 | */
83 | public function update(Request $request, $id)
84 | {
85 | $this->validate($request, [
86 | 'name' => 'required|max:255',
87 | 'short_name' => 'required|max:100'
88 | ]);
89 |
90 | $game = $this->gameModel->find($id);
91 |
92 | if (!$game) {
93 | return $this->recordNotFound();
94 | }
95 |
96 | // TODO: Add support for updating the platforms,
97 | // that is once testing has been added for
98 | // platforms.
99 | $game->name = $request->input('name');
100 | $game->short_name = $request->input('short_name');
101 | $game->slug = str_slug($request->input('name'));
102 | $game->logo = $request->input('logo');
103 | $game->banner = $request->input('banner');
104 |
105 | $game->save();
106 |
107 | return response()->json($game);
108 | }
109 |
110 | /**
111 | * Remove the specified resource from storage.
112 | *
113 | * @param int $id
114 | *
115 | * @return \Illuminate\Http\Response
116 | */
117 | public function destroy($id)
118 | {
119 | $game = $this->gameModel->find($id);
120 |
121 | if (!$game) {
122 | return $this->recordNotFound();
123 | }
124 |
125 | $game->delete();
126 |
127 | return response(null, 200);
128 | }
129 | }
130 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Api/PlatformsController.php:
--------------------------------------------------------------------------------
1 | platformModel = $platformModel;
15 | }
16 |
17 | /**
18 | * Display a listing of the resource.
19 | *
20 | * @return \Illuminate\Http\Response
21 | */
22 | public function index()
23 | {
24 | $platforms = $this->platformModel->all();
25 |
26 | return response()->json($platforms->toArray());
27 | }
28 |
29 | /**
30 | * Store a newly created resource in storage.
31 | *
32 | * TODO: Add the banners and logos here...
33 | * @param \Illuminate\Http\Request $request
34 | *
35 | * @return \Illuminate\Http\Response
36 | */
37 | public function store(Request $request)
38 | {
39 | $this->validate($request, [
40 | 'name' => 'required|max:255',
41 | 'short_name' => 'required|max:100'
42 | ]);
43 |
44 | $platform = new $this->platformModel([
45 | 'name' => $request->input('name'),
46 | 'short_name' => $request->input('short_name'),
47 | 'slug' => str_slug($request->input('name')),
48 | 'logo' => '',
49 | 'banner' => ''
50 | ]);
51 | $platform->save();
52 |
53 | return response()->json($platform);
54 | }
55 |
56 | /**
57 | * Display the specified resource.
58 | *
59 | * @param int $id
60 | *
61 | * @return \Illuminate\Http\Response
62 | */
63 | public function show($id)
64 | {
65 | $platform = $this->platformModel->find($id);
66 |
67 | if (!$platform) {
68 | return $this->recordNotFound();
69 | }
70 |
71 | return response()->json($platform);
72 | }
73 |
74 | /**
75 | * Update the specified resource in storage.
76 | *
77 | * @param \Illuminate\Http\Request $request
78 | * @param int $id
79 | *
80 | * @return \Illuminate\Http\Response
81 | */
82 | public function update(Request $request, $id)
83 | {
84 | $this->validate($request, [
85 | 'name' => 'required|max:255',
86 | 'short_name' => 'required|max:100'
87 | ]);
88 |
89 | $platform = $this->platformModel->find($id);
90 |
91 | if (!$platform) {
92 | return $this->recordNotFound();
93 | }
94 |
95 | $platform->name = $request->input('name');
96 | $platform->short_name = $request->input('short_name');
97 | $platform->slug = str_slug($request->input('name'));
98 | $platform->logo = $request->input('logo');
99 | $platform->banner = $request->input('banner');
100 |
101 | $platform->save();
102 |
103 | return response()->json($platform);
104 | }
105 |
106 | /**
107 | * Remove the specified resource from storage.
108 | *
109 | * @param int $id
110 | *
111 | * @return \Illuminate\Http\Response
112 | */
113 | public function destroy($id)
114 | {
115 | $platform = $this->platformModel->find($id);
116 |
117 | if (!$platform) {
118 | return $this->recordNotFound();
119 | }
120 |
121 | $platform->delete();
122 |
123 | return response(null, 200);
124 | }
125 | }
126 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Api/PostsController.php:
--------------------------------------------------------------------------------
1 | postModel = $postModel;
16 | }
17 |
18 | public function index()
19 | {
20 | $posts = $this->postModel->with('user')->get();
21 |
22 | return response()->json($posts->toArray());
23 | }
24 |
25 | public function show($id)
26 | {
27 | $post = $this->postModel->with('user')->find($id);
28 |
29 | if (!$post) {
30 | return $this->recordNotFound();
31 | }
32 |
33 | return response()->json($post);
34 | }
35 |
36 | public function store(Request $request)
37 | {
38 | $this->validate($request, [
39 | 'title' => 'required|max:255|unique:posts',
40 | 'content' => 'required',
41 | 'status' => 'required|in:published,draft',
42 | 'excerpt' => 'required'
43 | ]);
44 |
45 | $post = new $this->postModel([
46 | 'title' => $request->input('title'),
47 | 'slug' => str_slug($request->input('name')),
48 | 'content' => $request->input('content'),
49 | 'status' => $request->input('status'),
50 | 'excerpt' => $request->input('excerpt')
51 | ]);
52 | $request->user()->posts()->save($post);
53 |
54 | return response()->json($post);
55 | }
56 |
57 | public function update(Request $request, $id)
58 | {
59 | $this->validate($request, [
60 | 'title' => 'required|max:255|unique:posts',
61 | 'content' => 'required',
62 | 'status' => 'required|in:published,draft',
63 | 'excerpt' => 'required'
64 | ]);
65 |
66 | $post = $this->postModel->find($id);
67 |
68 | if (!$post) {
69 | return $this->recordNotFound();
70 | }
71 |
72 | $post->title = $request->input('title');
73 | $post->slug = str_slug($request->input('name'));
74 | $post->content = $request->input('content');
75 | $post->status = $request->input('status');
76 | $post->excerpt = $request->input('excerpt');
77 | $post->save();
78 |
79 | return response()->json($post);
80 | }
81 |
82 | public function destroy($id)
83 | {
84 | $post = $this->postModel->find($id);
85 |
86 | if (!$post) {
87 | return $this->recordNotFound();
88 | }
89 |
90 | $post->delete();
91 |
92 | return response(null, 200);
93 | }
94 |
95 | }
96 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Api/TeamsController.php:
--------------------------------------------------------------------------------
1 | teamModel = $teamModel;
16 | }
17 |
18 | public function index()
19 | {
20 | $teams = $this->teamModel->all();
21 | return response()->json($teams->toArray());
22 | }
23 |
24 | public function show($id)
25 | {
26 | $team = $this->teamModel->find($id);
27 |
28 | if (!$team) {
29 | return $this->recordNotFound();
30 | }
31 |
32 | return response()->json($team);
33 | }
34 |
35 | public function store(Request $request)
36 | {
37 | $this->validate($request, [
38 | 'name' => 'required|max:255',
39 | 'description' => 'required'
40 | ]);
41 |
42 | $team = new $this->teamModel([
43 | 'name' => $request->input('name'),
44 | 'slug' => str_slug($request->input('name')),
45 | 'description' => $request->input('description'),
46 | 'team_information' => 'Some default value... rip',
47 | 'owner_id' => $request->user()->id
48 | ]);
49 | $team->save();
50 |
51 | return response()->json($team);
52 | }
53 |
54 | public function update(Request $request, $id)
55 | {
56 | $this->validate($request, [
57 | 'name' => 'required|max:255',
58 | 'description' => 'required'
59 | ]);
60 |
61 | $team = $this->teamModel->find($id);
62 |
63 | if (!$team) {
64 | return $this->recordNotFound();
65 | }
66 |
67 | $team->name = $request->input('name');
68 | $team->slug = str_slug($request->input('name'));
69 | $team->description = $request->input('description');
70 |
71 | $team->save();
72 |
73 | return response()->json($team);
74 | }
75 |
76 | public function destroy($id)
77 | {
78 | $team = $this->teamModel->find($id);
79 |
80 | if (!$team) {
81 | return $this->recordNotFound();
82 | }
83 |
84 | $team->delete();
85 |
86 | return response(null, 200);
87 | }
88 |
89 | }
90 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Api/TournamentsController.php:
--------------------------------------------------------------------------------
1 | userModel = $userModel;
13 | }
14 |
15 | public function index()
16 | {
17 | $users = $this->userModel->all();
18 |
19 | return response()->json($users->toArray());
20 | }
21 |
22 | public function show($id)
23 | {
24 | $user = $this->userModel->find($id);
25 |
26 | if (!$user) {
27 | return $this->recordNotFound();
28 | }
29 |
30 | return response()->json($user);
31 | }
32 |
33 | public function verify()
34 | {
35 |
36 | }
37 |
38 | public function destroy($id)
39 | {
40 | $user = $this->userModel->find($id);
41 |
42 | if (!$user) {
43 | return $this->recordNotFound();
44 | }
45 |
46 | $user->delete();
47 | return response(null, 200);
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/ForgotPasswordController.php:
--------------------------------------------------------------------------------
1 | middleware('guest');
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/LoginController.php:
--------------------------------------------------------------------------------
1 | middleware('guest', ['except' => 'logout']);
32 | }
33 | }
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/PasswordController.php:
--------------------------------------------------------------------------------
1 | middleware($this->guestMiddleware());
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/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 | * @return \Illuminate\Contracts\Validation\Validator
49 | */
50 | protected function validator(array $data)
51 | {
52 | return Validator::make($data, [
53 | 'username' => 'required|unique:users',
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 | * @return User
65 | */
66 | protected function create(array $data)
67 | {
68 | $user = User::create([
69 | 'username' => $data['username'],
70 | 'name' => $data['name'],
71 | 'email' => $data['email'],
72 | 'password' => bcrypt($data['password']),
73 | ]);
74 |
75 | // Create an access token for the user...
76 | // when there are JSON components in the front-end..
77 | // $token = $user->createToken('Personal Token', ['regular'])->accessToken;
78 |
79 | // Probably should be queued...
80 | Mail::to($data['email'])->send(new AccountCreated($user));
81 | return $user;
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/ResetPasswordController.php:
--------------------------------------------------------------------------------
1 | middleware('guest');
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Controller.php:
--------------------------------------------------------------------------------
1 | json([
24 | 'message' => 'Record not found'
25 | ], 404);
26 | }
27 |
28 | }
--------------------------------------------------------------------------------
/app/Http/Controllers/Site/HomeController.php:
--------------------------------------------------------------------------------
1 | getTournaments();
28 | dd($tournaments);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Site/PageController.php:
--------------------------------------------------------------------------------
1 | first();
20 | return renderView('player-view', ['user' => $user]);
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Site/ProfileController.php:
--------------------------------------------------------------------------------
1 | middleware('auth');
16 | }
17 |
18 | public function index()
19 | {
20 | return renderView('teams');
21 | }
22 |
23 | public function show($id)
24 | {
25 | return renderView('team-view', ['team' => Team::find($id)]);
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Site/TeamInvitesController.php:
--------------------------------------------------------------------------------
1 | check()) {
22 | User::acceptInvite($invite);
23 | return redirect('/teams');
24 | } else {
25 | session(['invite_token' => $token]);
26 | return redirect()->to('login');
27 | }
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Site/TournamentController.php:
--------------------------------------------------------------------------------
1 | $tournament]);
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/app/Http/Kernel.php:
--------------------------------------------------------------------------------
1 | [
27 | \App\Http\Middleware\EncryptCookies::class,
28 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
29 | \Illuminate\Session\Middleware\StartSession::class,
30 | \Illuminate\View\Middleware\ShareErrorsFromSession::class,
31 | \App\Http\Middleware\VerifyCsrfToken::class,
32 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
33 | ],
34 |
35 | 'api' => [
36 | 'throttle:60,1',
37 | 'bindings',
38 | ],
39 | ];
40 |
41 | /**
42 | * The application's route middleware.
43 | *
44 | * These middleware may be assigned to groups or used individually.
45 | *
46 | * @var array
47 | */
48 | protected $routeMiddleware = [
49 | 'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
50 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
51 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
52 | 'can' => \Illuminate\Auth\Middleware\Authorize::class,
53 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
54 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
55 | 'scopes' => \Laravel\Passport\Http\Middleware\CheckScopes::class,
56 | 'scope' => \Laravel\Passport\Http\Middleware\CheckForAnyScope::class,
57 | ];
58 | }
59 |
--------------------------------------------------------------------------------
/app/Http/Middleware/EncryptCookies.php:
--------------------------------------------------------------------------------
1 | check()) {
22 | return redirect('/');
23 | }
24 |
25 | return $next($request);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/Http/Middleware/VerifyCsrfToken.php:
--------------------------------------------------------------------------------
1 | user = $user;
30 | }
31 |
32 | /**
33 | * Build the message.
34 | *
35 | * TODO: use the with() method to prevent developers from having to
36 | * specifically edit this file with more information? OR something like that.
37 | * @return $this
38 | */
39 | public function build()
40 | {
41 | return $this->view('emails.accounts.created');
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/app/Models/Game.php:
--------------------------------------------------------------------------------
1 | belongsToMany('App\Models\Platform', 'platform_game');
23 | }
24 |
25 | public function toArray()
26 | {
27 | $data = parent::toArray();
28 |
29 | if ($this->platforms) {
30 | $data['platforms'] = $this->platforms->toArray();
31 | } else {
32 | $data['platforms'] = null;
33 | }
34 |
35 | return $data;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/Models/Platform.php:
--------------------------------------------------------------------------------
1 | belongsToMany('App\Models\Game', 'platform_game');
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/Models/Post.php:
--------------------------------------------------------------------------------
1 | belongsTo('App\Models\User');
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/app/Models/Team.php:
--------------------------------------------------------------------------------
1 | belongsToMany('App\Models\User', 'team_user')
27 | ->withPivot(['is_admin']);
28 | }
29 |
30 | // A team can be signed-up for many tournaments.
31 | public function tournaments()
32 | {
33 | return $this->belongsToMany('App\Models\Tournament', 'team_tournament')
34 | ->withPivot(['checked_in', 'disqualified']);
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/app/Models/TeamInvite.php:
--------------------------------------------------------------------------------
1 | where('accept_token', '=', $token)->first();
13 | }
14 |
15 | public function team()
16 | {
17 | return $this->hasOne('App\Models\Team', 'id', 'team_id');
18 | }
19 |
20 | public function user()
21 | {
22 | return $this->hasOne('App\Models\User', 'id', 'user_id');
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/Models/Tournament.php:
--------------------------------------------------------------------------------
1 | belongsToMany('App\Models\Team', 'team_tournament');
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/app/Models/User.php:
--------------------------------------------------------------------------------
1 | teams()->toggle($invite->team);
36 | $invite->delete();
37 | }
38 |
39 | public function posts()
40 | {
41 | return $this->hasMany('App\Models\Post');
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/app/Notifications/JoinedTournamentConfirmation.php:
--------------------------------------------------------------------------------
1 | line('The introduction to the notification.')
45 | ->action('Notification Action', 'https://laravel.com')
46 | ->line('Thank you for using our application!');
47 | }
48 |
49 | /**
50 | * Get the array representation of the notification.
51 | *
52 | * @param mixed $notifiable
53 | * @return array
54 | */
55 | public function toArray($notifiable)
56 | {
57 | return [
58 | //
59 | ];
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/app/Notifications/ReceivedTeamInvitation.php:
--------------------------------------------------------------------------------
1 | team = $team;
25 | $this->invite_token = $invite_token;
26 | }
27 |
28 | /**
29 | * Get the notification's delivery channels.
30 | *
31 | * COULD Probably do a database notification as well for on-site notifications.
32 | *
33 | * @param mixed $notifiable
34 | * @return array
35 | */
36 | public function via($notifiable)
37 | {
38 | return ['mail'];
39 | }
40 |
41 | /**
42 | * Get the mail representation of the notification.
43 | *
44 | * @param mixed $notifiable
45 | * @return \Illuminate\Notifications\Messages\MailMessage
46 | */
47 | public function toMail($notifiable)
48 | {
49 | $invite_url = config('app.url') . '/teams/invite/' . $this->invite_token;
50 | return (new MailMessage)
51 | ->success()
52 | ->line('Congrats! You have just been invited to the team: "'. $this->team->name .'"!')
53 | ->action('Accept Invite', $invite_url)
54 | ->line('If there are any issues, please contact the team admin directly.');
55 | }
56 |
57 | /**
58 | * Get the array representation of the notification.
59 | *
60 | * @param mixed $notifiable
61 | * @return array
62 | */
63 | public function toArray($notifiable)
64 | {
65 | return [
66 | //
67 | ];
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/app/Notifications/TournamentStarting.php:
--------------------------------------------------------------------------------
1 | `");
40 | }
41 |
42 | /**
43 | * Get the mail representation of the notification.
44 | * THIS IS DUMMY DATA...
45 | * @param mixed $notifiable
46 | * @return \Illuminate\Notifications\Messages\MailMessage
47 | */
48 | public function toMail($notifiable)
49 | {
50 | return (new MailMessage)
51 | ->line('The tournament you have joined is now starting.')
52 | ->action('Click Here to Check-in', 'https://bracket/tournament/12/checkin')
53 | ->line('GLHF!')
54 | ->line('You are receiving this notification because you signed up for a tournament.');
55 | }
56 |
57 | /**
58 | * Get the array representation of the notification.
59 | *
60 | * @param mixed $notifiable
61 | * @return array
62 | */
63 | public function toArray($notifiable)
64 | {
65 | return [
66 | //
67 | ];
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/app/Providers/AppServiceProvider.php:
--------------------------------------------------------------------------------
1 | 'App\Policies\ModelPolicy',
18 | ];
19 |
20 | /**
21 | * Register any authentication / authorization services.
22 | *
23 | * @return void
24 | */
25 | public function boot()
26 | {
27 | $this->registerPolicies();
28 |
29 | // Permissions for API routes
30 | Passport::tokensCan([
31 | 'admin' => 'Allows access to all API endpoints and actions.',
32 | 'users' => 'Allows read access to users and access to own user account.',
33 | 'posts' => 'Allows access to publish and read posts.',
34 | 'tournaments' => 'Allows read access to tournaments.',
35 | 'teams' => 'Allows read access to teams and write access to own account.',
36 | 'user' => 'Allows read/write access to own account and read access to most API endpoints.'
37 | ]);
38 |
39 | Passport::routes();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/Providers/EventServiceProvider.php:
--------------------------------------------------------------------------------
1 | [
17 | 'App\Listeners\EventListener',
18 | ],
19 | ];
20 |
21 | /**
22 | * Register any events for your application.
23 | *
24 | * @return void
25 | */
26 | public function boot()
27 | {
28 | parent::boot();
29 |
30 | //
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/Providers/RouteServiceProvider.php:
--------------------------------------------------------------------------------
1 | mapWebRoutes();
39 |
40 | $this->mapApiRoutes();
41 |
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 | 'namespace' => $this->namespace, 'middleware' => 'web',
56 | ], function ($router) {
57 | require base_path('routes/web.php');
58 | });
59 | }
60 |
61 | /**
62 | * Define the "api" routes for the application.
63 | *
64 | * These routes are typically stateless.
65 | * TODO: RE-add auth:api to the middleware scope
66 | * @return void
67 | */
68 | protected function mapApiRoutes()
69 | {
70 | Route::group([
71 | 'middleware' => ['api'],
72 | 'namespace' => $this->namespace,
73 | 'prefix' => 'api',
74 | ], function ($router) {
75 | require base_path('routes/api.php');
76 | });
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/app/Support/Helpers.php:
--------------------------------------------------------------------------------
1 | 'No extra data.']) {
5 | $defaults = [
6 | 'games' => App\Models\Game::all(),
7 | 'platforms' => App\Models\Platform::all(),
8 | 'users' => App\Models\User::all(),
9 | 'teams' => App\Models\Team::all(),
10 | ];
11 |
12 | // Filter out data based on what the view accesses?
13 | // or something similar...
14 |
15 | // TODO: figure out how to extract needed values? if this is wanted I suppose
16 | // renderView('members', ['members', 'teams', 'tournaments']);
17 | // renderView('members', 'view', ['members', 'teams', 'tournaments']);
18 |
19 | $page_data = array_merge($defaults, $extras);
20 | return view('site.' . $view, $page_data);
21 | }
22 |
23 | function getViewData($name) {
24 | // an array of things a view can access
25 | $accessible = [
26 | 'users', 'games', 'platforms', 'tournaments'
27 | ];
28 |
29 | // get the data based on name?
30 | // return the data as a collection?
31 | // do something?
32 | }
--------------------------------------------------------------------------------
/app/Traits/Teams/TeamTrait.php:
--------------------------------------------------------------------------------
1 | user_id = $user;
17 | $invite->team_id = $this->id;
18 | $invite->email = $user->email;
19 | $invite->accept_token = $token;
20 | $invite->deny_token = $token;
21 | $invite->save();
22 |
23 | $notification = new ReceivedTeamInvitation($this, $token);
24 | return $user->notify($notification);
25 | }
26 |
27 | // Should re-send the invitation based on the invitation $id.
28 | public function resendInvite() { return false; }
29 |
30 | // Removes a user from a team.
31 | public function removeUser(User $user)
32 | {
33 | return $this->members()->toggle($user);
34 | }
35 |
36 | public function hasMember(User $user)
37 | {
38 | return $this->members()->where('id', "=", $user->id)->first() ? true : false;
39 | }
40 |
41 | public function owner()
42 | {
43 | return $this->hasOne('App\Models\User', 'id', 'owner_id');
44 | }
45 |
46 | public function invites()
47 | {
48 | // should return all the invites that have been sent out!
49 | }
50 |
51 | public function members()
52 | {
53 | return $this->belongsToMany('App\Models\User', 'team_user')
54 | ->withPivot(['is_admin']);
55 | }
56 |
57 | }
--------------------------------------------------------------------------------
/app/Traits/Users/HasTeams.php:
--------------------------------------------------------------------------------
1 | teams()->toggle($team);
13 | }
14 |
15 | // define the relationship
16 | public function teams()
17 | {
18 | return $this->belongsToMany('App\Models\Team', 'team_user');
19 | }
20 |
21 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/bootstrap/autoload.php:
--------------------------------------------------------------------------------
1 | =5.6.4",
9 | "laravel/framework": "5.3.*",
10 | "team-reflex/challonge-php": "^1.0",
11 | "laravel/passport": "^1.0@dev",
12 | "laravel-notification-channels/discord": "^0.0.1",
13 | "team-reflex/discord-php": "^4.0"
14 | },
15 | "require-dev": {
16 | "fzaninotto/faker": "~1.4",
17 | "mockery/mockery": "0.9.*",
18 | "phpunit/phpunit": "~5.0",
19 | "symfony/css-selector": "3.1.*",
20 | "symfony/dom-crawler": "3.1.*",
21 | "laravel/homestead": "^3.0",
22 | "doctrine/dbal": "^2.5"
23 | },
24 | "autoload": {
25 | "classmap": [
26 | "database"
27 | ],
28 | "psr-4": {
29 | "App\\": "app/"
30 | },
31 | "files": [
32 | "app/Support/Helpers.php"
33 | ]
34 | },
35 | "autoload-dev": {
36 | "classmap": [
37 | "tests/TestCase.php"
38 | ]
39 | },
40 | "scripts": {
41 | "post-root-package-install": [
42 | "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
43 | ],
44 | "post-create-project-cmd": [
45 | "php artisan key:generate"
46 | ],
47 | "post-install-cmd": [
48 | "Illuminate\\Foundation\\ComposerScripts::postInstall",
49 | "php artisan optimize"
50 | ],
51 | "post-update-cmd": [
52 | "Illuminate\\Foundation\\ComposerScripts::postUpdate",
53 | "php artisan optimize"
54 | ]
55 | },
56 | "config": {
57 | "preferred-install": "dist"
58 | },
59 | "minimum-stability": "dev",
60 | "prefer-stable": true
61 | }
62 |
--------------------------------------------------------------------------------
/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 |
44 | 'api' => [
45 | 'driver' => 'passport',
46 | 'provider' => 'users',
47 | ],
48 | ],
49 |
50 | /*
51 | |--------------------------------------------------------------------------
52 | | User Providers
53 | |--------------------------------------------------------------------------
54 | |
55 | | All authentication drivers have a user provider. This defines how the
56 | | users are actually retrieved out of your database or other storage
57 | | mechanisms used by this application to persist your user's data.
58 | |
59 | | If you have multiple user tables or models you may configure multiple
60 | | sources which represent each model / table. These sources may then
61 | | be assigned to any extra authentication guards you have defined.
62 | |
63 | | Supported: "database", "eloquent"
64 | |
65 | */
66 |
67 | 'providers' => [
68 | 'users' => [
69 | 'driver' => 'eloquent',
70 | 'model' => App\Models\User::class,
71 | ],
72 |
73 | // 'users' => [
74 | // 'driver' => 'database',
75 | // 'table' => 'users',
76 | // ],
77 | ],
78 |
79 | /*
80 | |--------------------------------------------------------------------------
81 | | Resetting Passwords
82 | |--------------------------------------------------------------------------
83 | |
84 | | Here you may set the options for resetting passwords including the view
85 | | that is your password reset e-mail. You may also set the name of the
86 | | table that maintains all of the reset tokens for your application.
87 | |
88 | | You may specify multiple password reset configurations if you have more
89 | | than one user table or model in the application and you want to have
90 | | separate password reset settings based on the specific user types.
91 | |
92 | | The expire time is the number of minutes that the reset token should be
93 | | considered valid. This security feature keeps tokens short-lived so
94 | | they have less time to be guessed. You may change this as needed.
95 | |
96 | */
97 |
98 | 'passwords' => [
99 | 'users' => [
100 | 'provider' => 'users',
101 | 'table' => 'password_resets',
102 | 'expire' => 60,
103 | ],
104 | ],
105 |
106 | ];
107 |
--------------------------------------------------------------------------------
/config/broadcasting.php:
--------------------------------------------------------------------------------
1 | env('BROADCAST_DRIVER', 'pusher'),
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 | ],
53 |
54 | ];
55 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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/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 |
--------------------------------------------------------------------------------
/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' => ['address' => 'bracket@bracket.dev', 'name' => 'Bracket Development'],
59 |
60 | /*
61 | |--------------------------------------------------------------------------
62 | | E-Mail Encryption Protocol
63 | |--------------------------------------------------------------------------
64 | |
65 | | Here you may specify the encryption protocol that should be used when
66 | | the application send e-mail messages. A sensible default using the
67 | | transport layer security protocol should provide great security.
68 | |
69 | */
70 |
71 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
72 |
73 | /*
74 | |--------------------------------------------------------------------------
75 | | SMTP Server Username
76 | |--------------------------------------------------------------------------
77 | |
78 | | If your SMTP server requires a username for authentication, you should
79 | | set it here. This will get used to authenticate with your server on
80 | | connection. You may also set the "password" value below this one.
81 | |
82 | */
83 |
84 | 'username' => env('MAIL_USERNAME'),
85 |
86 | /*
87 | |--------------------------------------------------------------------------
88 | | SMTP Server Password
89 | |--------------------------------------------------------------------------
90 | |
91 | | Here you may set the password required by your SMTP server to send out
92 | | messages from your application. This will be given to the server on
93 | | connection so that the application will be able to send messages.
94 | |
95 | */
96 |
97 | 'password' => env('MAIL_PASSWORD'),
98 |
99 | /*
100 | |--------------------------------------------------------------------------
101 | | Sendmail System Path
102 | |--------------------------------------------------------------------------
103 | |
104 | | When using the "sendmail" driver to send e-mails, we will need to know
105 | | the path to where Sendmail lives on this server. A default path has
106 | | been provided here, which will work well on most of your systems.
107 | |
108 | */
109 |
110 | 'sendmail' => '/usr/sbin/sendmail -bs',
111 |
112 | 'pretend' => false,
113 |
114 | ];
115 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/config/services.php:
--------------------------------------------------------------------------------
1 | [
18 | 'domain' => env('MAILGUN_DOMAIN'),
19 | 'secret' => env('MAILGUN_SECRET'),
20 | ],
21 |
22 | 'discord' => [
23 | 'token' => env('DISCORD_TOKEN', null),
24 | ],
25 |
26 | 'ses' => [
27 | 'key' => env('SES_KEY'),
28 | 'secret' => env('SES_SECRET'),
29 | 'region' => 'us-east-1',
30 | ],
31 |
32 | 'sparkpost' => [
33 | 'secret' => env('SPARKPOST_SECRET'),
34 | ],
35 |
36 | 'stripe' => [
37 | 'model' => App\User::class,
38 | 'key' => env('STRIPE_KEY'),
39 | 'secret' => env('STRIPE_SECRET'),
40 | ],
41 |
42 | ];
43 |
--------------------------------------------------------------------------------
/config/teamwork.php:
--------------------------------------------------------------------------------
1 | App\User::class,
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Teamwork users Table
24 | |--------------------------------------------------------------------------
25 | |
26 | | This is the users table name used by Teamwork.
27 | |
28 | */
29 | 'users_table' => 'users',
30 |
31 | /*
32 | |--------------------------------------------------------------------------
33 | | Teamwork Team Model
34 | |--------------------------------------------------------------------------
35 | |
36 | | This is the Team model used by Teamwork to create correct relations. Update
37 | | the team if it is in a different namespace.
38 | |
39 | */
40 | 'team_model' => Mpociot\Teamwork\TeamworkTeam::class,
41 |
42 | /*
43 | |--------------------------------------------------------------------------
44 | | Teamwork teams Table
45 | |--------------------------------------------------------------------------
46 | |
47 | | This is the teams table name used by Teamwork to save teams to the database.
48 | |
49 | */
50 | 'teams_table' => 'teams',
51 |
52 | /*
53 | |--------------------------------------------------------------------------
54 | | Teamwork team_user Table
55 | |--------------------------------------------------------------------------
56 | |
57 | | This is the team_user table used by Teamwork to save assigned teams to the
58 | | database.
59 | |
60 | */
61 | 'team_user_table' => 'team_user',
62 |
63 | /*
64 | |--------------------------------------------------------------------------
65 | | User Foreign key on Teamwork's team_user Table (Pivot)
66 | |--------------------------------------------------------------------------
67 | */
68 | 'user_foreign_key' => 'id',
69 |
70 | /*
71 | |--------------------------------------------------------------------------
72 | | Teamwork Team Invite Model
73 | |--------------------------------------------------------------------------
74 | |
75 | | This is the Team Invite model used by Teamwork to create correct relations.
76 | | Update the team if it is in a different namespace.
77 | |
78 | */
79 | 'invite_model' => Mpociot\Teamwork\TeamInvite::class,
80 |
81 | /*
82 | |--------------------------------------------------------------------------
83 | | Teamwork team invites Table
84 | |--------------------------------------------------------------------------
85 | |
86 | | This is the team invites table name used by Teamwork to save sent/pending
87 | | invitation into teams to the database.
88 | |
89 | */
90 | 'team_invites_table' => 'team_invites',
91 | ];
92 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/database/.gitignore:
--------------------------------------------------------------------------------
1 | *.sqlite
2 |
--------------------------------------------------------------------------------
/database/factories/ModelFactory.php:
--------------------------------------------------------------------------------
1 | define(App\Models\User::class, function (Faker\Generator $faker) {
15 | return [
16 | 'username' => $faker->username,
17 | 'name' => $faker->name,
18 | 'email' => $faker->safeEmail,
19 | 'password' => bcrypt(str_random(10)),
20 | 'remember_token' => str_random(10),
21 | ];
22 | });
23 |
24 | $factory->define(App\Models\Game::class, function (Faker\Generator $faker) {
25 | return [
26 | 'name' => $faker->name,
27 | 'short_name' => $faker->word,
28 | 'slug' => str_replace(' ', '-', $faker->name),
29 | 'logo' => '',
30 | 'banner' => ''
31 | ];
32 | });
33 |
34 | $factory->define(App\Models\Platform::class, function (Faker\Generator $faker) {
35 | return [
36 | 'name' => $faker->name,
37 | 'short_name' => $faker->word,
38 | 'slug' => str_replace(' ', '-', $faker->name),
39 | 'logo' => '',
40 | 'banner' => ''
41 | ];
42 | });
43 |
44 | $factory->define(App\Models\Post::class, function (Faker\Generator $faker) {
45 | return [
46 | 'title' => $faker->name,
47 | 'slug' => str_replace(' ', '-', $faker->name),
48 | 'content' => $faker->text($maxNbvChars=500),
49 | 'excerpt' => $faker->paragraph,
50 | 'status' => 'published',
51 | 'user_id' => 1
52 | ];
53 | });
54 |
55 | $factory->define(App\Models\Team::class, function (Faker\Generator $faker) {
56 | return [
57 | 'name' => $faker->name,
58 | 'slug' => str_replace(' ', '-', $faker->name),
59 | 'description' => $faker->paragraph,
60 | 'team_information' => $faker->text($maxNbvChars=500),
61 | 'owner_id' => 1
62 | ];
63 | });
64 |
--------------------------------------------------------------------------------
/database/migrations/.gitkeep:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_000000_create_users_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
17 | $table->string('name');
18 | $table->string('username')->unique();
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 |
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_100000_create_password_resets_table.php:
--------------------------------------------------------------------------------
1 | string('email')->index();
17 | $table->string('token')->index();
18 | $table->timestamp('created_at');
19 | });
20 | }
21 |
22 | /**
23 | * Reverse the migrations.
24 | *
25 | * @return void
26 | */
27 | public function down()
28 | {
29 | Schema::drop('password_resets');
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/database/migrations/2016_05_25_043614_create_platforms_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
17 | $table->string('name');
18 | $table->string('short_name');
19 | $table->string('slug')->unique();
20 | $table->string('logo');
21 | $table->string('banner');
22 | });
23 | }
24 |
25 | /**
26 | * Reverse the migrations.
27 | *
28 | * @return void
29 | */
30 | public function down()
31 | {
32 | Schema::drop('platforms');
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/database/migrations/2016_05_25_043623_create_games_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
17 | $table->string('name', 100);
18 | $table->string('short_name');
19 | $table->string('slug')->unique();
20 | $table->string('logo');
21 | $table->string('banner');
22 | });
23 | }
24 |
25 | /**
26 | * Reverse the migrations.
27 | *
28 | * @return void
29 | */
30 | public function down()
31 | {
32 | Schema::drop('games');
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/database/migrations/2016_05_25_184909_add_platform_game_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
17 | $table->integer('game_id');
18 | $table->integer('platform_id');
19 | $table->timestamps();
20 | });
21 | }
22 |
23 | /**
24 | * Reverse the migrations.
25 | *
26 | * @return void
27 | */
28 | public function down()
29 | {
30 | Schema::drop('platform_game');
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/database/migrations/2016_07_29_061330_create_posts_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
17 | $table->integer('user_id')->unsigned();
18 | $table->enum('status', ['published', 'draft']);
19 | $table->string('title');
20 | $table->string('slug');
21 | $table->text('content');
22 | $table->string('excerpt');
23 | $table->foreign('user_id')->references('id')->on('users');
24 | $table->timestamps();
25 | });
26 | }
27 |
28 | /**
29 | * Reverse the migrations.
30 | *
31 | * @return void
32 | */
33 | public function down()
34 | {
35 | // Schema::table('posts', function(Blueprint $table) {
36 | // $table->dropForeign(['user_id']);
37 | // });
38 | Schema::drop('posts');
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/database/migrations/2016_08_18_021209_create_tournaments_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('name');
19 | $table->string('slug')->unique();
20 | $table->string('description');
21 | $table->text('rules')->nullable();
22 | $table->text('prizes')->nullable();
23 | $table->enum('type', ['single_elimination', 'double_elimination', 'round_robin', 'swiss'])->default('single_elimination');
24 | $table->integer('challonge_id')->nullable();
25 | $table->integer('checkin_time');
26 | $table->dateTime('start_at');
27 | $table->timestamps();
28 | });
29 | }
30 |
31 | /**
32 | * Reverse the migrations.
33 | *
34 | * @return void
35 | */
36 | public function down()
37 | {
38 | Schema::drop('tournaments');
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/database/migrations/2016_08_18_062025_setup_team_tables.php:
--------------------------------------------------------------------------------
1 | integer('current_team_id')->unsigned()->nullable();
18 | });
19 |
20 | Schema::create('teams', function(Blueprint $table) {
21 | $table->increments('id');
22 | $table->integer('owner_id')->unsigned();
23 |
24 | $table->string('name');
25 | $table->string('slug')->unique();
26 | $table->string('description');
27 | $table->text('team_information');
28 |
29 | $table->timestamps();
30 | });
31 |
32 | Schema::create('team_user', function(Blueprint $table) {
33 | $table->integer('user_id')->unsigned();
34 | $table->integer('team_id')->unsigned();
35 | $table->timestamps();
36 |
37 | $table->foreign('user_id')->references('id')->on('users')->onUpdate('cascade')->onDelete('cascade');
38 | $table->foreign('team_id')->references('id')->on('teams')->onDelete('cascade');
39 | });
40 |
41 | Schema::create('team_invites', function(Blueprint $table) {
42 | $table->increments('id');
43 | $table->integer('user_id')->unsigned();
44 | $table->integer('team_id')->unsigned();
45 | $table->enum('type', ['invite', 'request']);
46 | $table->string('accept_token');
47 | $table->string('deny_token');
48 | $table->timestamps();
49 |
50 | $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
51 | });
52 | }
53 |
54 | /**
55 | * Reverse the migrations.
56 | *
57 | * @return void
58 | */
59 | public function down()
60 | {
61 | Schema::table('users', function(Blueprint $table) {
62 | $table->dropColumn('current_team_id');
63 | });
64 |
65 | Schema::table('team_user', function(Blueprint $table) {
66 | $table->dropForeign('team_user_user_id_foreign');
67 | $table->dropForeign('team_user_team_id_foreign');
68 | });
69 |
70 | Schema::drop('team_user');
71 | Schema::drop('team_invites');
72 | Schema::drop('teams');
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/database/seeds/.gitkeep:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/database/seeds/DatabaseSeeder.php:
--------------------------------------------------------------------------------
1 | call(UsersTableSeeder::class);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/gulpfile.js:
--------------------------------------------------------------------------------
1 | var 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(function(mix) {
17 | mix.sass('app.scss')
18 | .webpack('app.js', 'public/js', 'resources/assets/js')
19 | .webpack('main.js', 'public/js/admin', 'resources/assets/js/admin')
20 | .browserSync({
21 | proxy: 'bracket',
22 | notify: false,
23 | open: false
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "scripts": {
4 | "prod": "gulp --production",
5 | "dev": "gulp watch"
6 | },
7 | "devDependencies": {
8 | "animate.css": "^3.5.1",
9 | "animejs": "^1.1.0",
10 | "babel-plugin-lodash": "^3.2.0",
11 | "babel-plugin-transform-object-rest-spread": "^6.8.0",
12 | "babel-preset-stage-2": "^6.11.0",
13 | "bootstrap": "^4.0.0-alpha.3",
14 | "bootstrap-sass": "^3.3.0",
15 | "gulp": "^3.9.1",
16 | "jquery": "^3.1.0",
17 | "js-cookie": "^2.1.2",
18 | "laravel-elixir": "^6.0.0-9",
19 | "laravel-elixir-browserify-official": "^0.1.3",
20 | "laravel-elixir-browsersync-official": "^1.0.0",
21 | "laravel-elixir-vue": "^0.1.4",
22 | "laravel-elixir-webpack-official": "^1.0.2",
23 | "lodash": "^4.13.1",
24 | "nprogress": "^0.2.0",
25 | "tether": "^1.3.4",
26 | "vue": "^1.0.26",
27 | "vue-moment": "^2.0.1",
28 | "vue-resource": "^0.9.3",
29 | "vue-router": "^0.7.13"
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
ID | 17 |Name | 18 |Short Name | 19 |Slug | 20 |21 | |
---|---|---|---|---|
{{ game.id }} 26 | | {{ game.name }} | 27 |{{ game.short_name }} | 28 |{{ game.slug }} | 29 |
30 |
31 |
34 |
40 |
39 | |
41 |
ID | 15 |Name | 16 |Short Name | 17 |Slug | 18 |19 | |
---|---|---|---|---|
{{ platform.id }} 24 | | {{ platform.name }} | 25 |{{ platform.short_name }} | 26 |{{ platform.slug }} | 27 |
28 |
29 |
32 |
38 |
37 | |
39 |
ID | 8 |Name | 9 |Username | 10 |Joined | 12 |13 | | |
---|---|---|---|---|---|
{{ user.id }} 18 | | {{ user.name }} | 19 |{{ user.username }} | 20 |{{ user.email }} | 21 |{{ user.created_at | moment "MMM Do YYYY, h:mm:ss a" }} | 22 |
23 |
24 |
27 |
33 |
32 | |
34 |
Name | 18 |Scopes | 19 |20 | 21 | 22 | 23 | |
---|---|---|
26 | {{ token.client.name }} 27 | | 28 | 29 | 30 |31 | 32 | {{ token.scopes.join(', ') }} 33 | 34 | | 35 | 36 | 37 |38 | 39 | Revoke 40 | 41 | | 42 |
Welcome to the site! {{ $user->name }}!
2 |We have you with the username ({{ $user->username }}).
-------------------------------------------------------------------------------- /resources/views/errors/404.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |{{ $team->name }} | {{ $team->slug }}
9 |Name | 18 |Status | 19 |20 | |
---|---|---|
{{ $team->name }} | 26 |27 | @if(auth()->user()->isOwnerOfTeam($team)) 28 | Owner 29 | @else 30 | Member 31 | @endif 32 | | 33 |34 | @if(is_null(auth()->user()->currentTeam) || auth()->user()->currentTeam->getKey() !== $team->getKey()) 35 | 36 | Switch 37 | 38 | @else 39 | Current team 40 | @endif 41 | 42 | 43 | Members 44 | 45 | 46 | @if(auth()->user()->isOwnerOfTeam($team)) 47 | 48 | 49 | Edit 50 | 51 | 52 | 57 | @endif 58 | | 59 |
Username | 20 |Action | 21 |
---|---|
{{ $user->username }} | 27 |28 | @if(auth()->user()->isOwnerOfTeam($team)) 29 | @if(auth()->user()->getKey() !== $user->getKey()) 30 | 35 | @endif 36 | @endif 37 | | 38 |
Email Address | 82 |Actions | 83 |
---|---|
{{ $invite->email }} | 89 |90 | 91 | Resend invite 92 | 93 | | 94 |