@@ -8,23 +8,23 @@ |
||
8 | 8 | */ |
9 | 9 | class League extends DsManagerOrm |
10 | 10 | { |
11 | - /** |
|
12 | - * @var string |
|
13 | - */ |
|
14 | - protected $table = 'leagues'; |
|
11 | + /** |
|
12 | + * @var string |
|
13 | + */ |
|
14 | + protected $table = 'leagues'; |
|
15 | 15 | |
16 | - /** |
|
17 | - * @var array |
|
18 | - */ |
|
19 | - protected $fillable = [ |
|
20 | - 'name' |
|
21 | - ]; |
|
16 | + /** |
|
17 | + * @var array |
|
18 | + */ |
|
19 | + protected $fillable = [ |
|
20 | + 'name' |
|
21 | + ]; |
|
22 | 22 | |
23 | - /** |
|
24 | - * @return \Illuminate\Database\Eloquent\Relations\HasMany |
|
25 | - */ |
|
26 | - public function match_days() |
|
27 | - { |
|
28 | - return $this->hasMany(MatchDay::class); |
|
29 | - } |
|
23 | + /** |
|
24 | + * @return \Illuminate\Database\Eloquent\Relations\HasMany |
|
25 | + */ |
|
26 | + public function match_days() |
|
27 | + { |
|
28 | + return $this->hasMany(MatchDay::class); |
|
29 | + } |
|
30 | 30 | } |
31 | 31 | \ No newline at end of file |
@@ -9,32 +9,32 @@ |
||
9 | 9 | class MatchDay extends DsManagerOrm |
10 | 10 | { |
11 | 11 | |
12 | - /** |
|
13 | - * @var string |
|
14 | - */ |
|
15 | - protected $table = 'league_match_days'; |
|
12 | + /** |
|
13 | + * @var string |
|
14 | + */ |
|
15 | + protected $table = 'league_match_days'; |
|
16 | 16 | |
17 | - /** |
|
18 | - * @var array |
|
19 | - */ |
|
20 | - protected $fillable = [ |
|
21 | - 'league_id', |
|
22 | - 'day' |
|
23 | - ]; |
|
17 | + /** |
|
18 | + * @var array |
|
19 | + */ |
|
20 | + protected $fillable = [ |
|
21 | + 'league_id', |
|
22 | + 'day' |
|
23 | + ]; |
|
24 | 24 | |
25 | - /** |
|
26 | - * @return \Illuminate\Database\Eloquent\Relations\HasOne |
|
27 | - */ |
|
28 | - public function league() |
|
29 | - { |
|
30 | - return $this->hasOne(League::class); |
|
31 | - } |
|
25 | + /** |
|
26 | + * @return \Illuminate\Database\Eloquent\Relations\HasOne |
|
27 | + */ |
|
28 | + public function league() |
|
29 | + { |
|
30 | + return $this->hasOne(League::class); |
|
31 | + } |
|
32 | 32 | |
33 | - /** |
|
34 | - * @return \Illuminate\Database\Eloquent\Relations\HasMany |
|
35 | - */ |
|
36 | - public function matches() |
|
37 | - { |
|
38 | - return $this->hasMany(Match::class); |
|
39 | - } |
|
33 | + /** |
|
34 | + * @return \Illuminate\Database\Eloquent\Relations\HasMany |
|
35 | + */ |
|
36 | + public function matches() |
|
37 | + { |
|
38 | + return $this->hasMany(Match::class); |
|
39 | + } |
|
40 | 40 | } |
41 | 41 | \ No newline at end of file |
@@ -5,18 +5,18 @@ |
||
5 | 5 | |
6 | 6 | class CreateLeaguesTable |
7 | 7 | { |
8 | - /** |
|
9 | - * Run the migrations. |
|
10 | - * |
|
11 | - * @return void |
|
12 | - */ |
|
13 | - public function run() |
|
14 | - { |
|
15 | - Capsule::schema()->dropIfExists('leagues'); |
|
16 | - Capsule::schema()->create('leagues', function (Blueprint $table) { |
|
17 | - $table->increments('id'); |
|
18 | - $table->string('name'); |
|
19 | - $table->timestamps(); |
|
20 | - }); |
|
21 | - } |
|
8 | + /** |
|
9 | + * Run the migrations. |
|
10 | + * |
|
11 | + * @return void |
|
12 | + */ |
|
13 | + public function run() |
|
14 | + { |
|
15 | + Capsule::schema()->dropIfExists('leagues'); |
|
16 | + Capsule::schema()->create('leagues', function (Blueprint $table) { |
|
17 | + $table->increments('id'); |
|
18 | + $table->string('name'); |
|
19 | + $table->timestamps(); |
|
20 | + }); |
|
21 | + } |
|
22 | 22 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | public function run() |
14 | 14 | { |
15 | 15 | Capsule::schema()->dropIfExists('leagues'); |
16 | - Capsule::schema()->create('leagues', function (Blueprint $table) { |
|
16 | + Capsule::schema()->create('leagues', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->string('name'); |
19 | 19 | $table->timestamps(); |
@@ -5,25 +5,25 @@ |
||
5 | 5 | |
6 | 6 | class CreateMatchTable |
7 | 7 | { |
8 | - /** |
|
9 | - * Run the migrations. |
|
10 | - * |
|
11 | - * @return void |
|
12 | - */ |
|
13 | - public function run() |
|
14 | - { |
|
15 | - Capsule::schema()->dropIfExists('matches'); |
|
16 | - Capsule::schema()->create('matches', function (Blueprint $table) { |
|
17 | - $table->increments('id'); |
|
18 | - $table->integer('league_match_day_id'); |
|
19 | - $table->integer('home_team_id'); |
|
20 | - $table->integer('goal_home')->default(0); |
|
21 | - $table->integer('away_team_id'); |
|
22 | - $table->integer('goal_away')->default(0); |
|
23 | - $table->boolean('simulated')->default(false); |
|
24 | - $table->text('info')->nullable(); |
|
25 | - $table->date('match_date')->default(\Carbon\Carbon::now()); |
|
26 | - $table->timestamps(); |
|
27 | - }); |
|
28 | - } |
|
8 | + /** |
|
9 | + * Run the migrations. |
|
10 | + * |
|
11 | + * @return void |
|
12 | + */ |
|
13 | + public function run() |
|
14 | + { |
|
15 | + Capsule::schema()->dropIfExists('matches'); |
|
16 | + Capsule::schema()->create('matches', function (Blueprint $table) { |
|
17 | + $table->increments('id'); |
|
18 | + $table->integer('league_match_day_id'); |
|
19 | + $table->integer('home_team_id'); |
|
20 | + $table->integer('goal_home')->default(0); |
|
21 | + $table->integer('away_team_id'); |
|
22 | + $table->integer('goal_away')->default(0); |
|
23 | + $table->boolean('simulated')->default(false); |
|
24 | + $table->text('info')->nullable(); |
|
25 | + $table->date('match_date')->default(\Carbon\Carbon::now()); |
|
26 | + $table->timestamps(); |
|
27 | + }); |
|
28 | + } |
|
29 | 29 | } |
@@ -5,19 +5,19 @@ |
||
5 | 5 | |
6 | 6 | class CreateLeagueMatchDaysTable |
7 | 7 | { |
8 | - /** |
|
9 | - * Run the migrations. |
|
10 | - * |
|
11 | - * @return void |
|
12 | - */ |
|
13 | - public function run() |
|
14 | - { |
|
15 | - Capsule::schema()->dropIfExists('league_match_days'); |
|
16 | - Capsule::schema()->create('league_match_days', function (Blueprint $table) { |
|
17 | - $table->increments('id'); |
|
18 | - $table->integer('league_id'); |
|
19 | - $table->integer('day')->default(0); |
|
20 | - $table->timestamps(); |
|
21 | - }); |
|
22 | - } |
|
8 | + /** |
|
9 | + * Run the migrations. |
|
10 | + * |
|
11 | + * @return void |
|
12 | + */ |
|
13 | + public function run() |
|
14 | + { |
|
15 | + Capsule::schema()->dropIfExists('league_match_days'); |
|
16 | + Capsule::schema()->create('league_match_days', function (Blueprint $table) { |
|
17 | + $table->increments('id'); |
|
18 | + $table->integer('league_id'); |
|
19 | + $table->integer('day')->default(0); |
|
20 | + $table->timestamps(); |
|
21 | + }); |
|
22 | + } |
|
23 | 23 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | public function run() |
14 | 14 | { |
15 | 15 | Capsule::schema()->dropIfExists('league_match_days'); |
16 | - Capsule::schema()->create('league_match_days', function (Blueprint $table) { |
|
16 | + Capsule::schema()->create('league_match_days', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->integer('league_id'); |
19 | 19 | $table->integer('day')->default(0); |
@@ -3,28 +3,28 @@ |
||
3 | 3 | |
4 | 4 | class A001LeaguesSeeder |
5 | 5 | { |
6 | - function run() |
|
7 | - { |
|
8 | - $leagues = [ |
|
9 | - 'friendly' => 5, |
|
10 | - 'europa league' => 2 |
|
11 | - ]; |
|
6 | + function run() |
|
7 | + { |
|
8 | + $leagues = [ |
|
9 | + 'friendly' => 5, |
|
10 | + 'europa league' => 2 |
|
11 | + ]; |
|
12 | 12 | |
13 | - foreach ($leagues as $league => $dayMatches) { |
|
14 | - $league = \App\Lib\DsManager\Models\Orm\League::create( |
|
15 | - [ |
|
16 | - 'name' => $league |
|
17 | - ] |
|
18 | - ); |
|
13 | + foreach ($leagues as $league => $dayMatches) { |
|
14 | + $league = \App\Lib\DsManager\Models\Orm\League::create( |
|
15 | + [ |
|
16 | + 'name' => $league |
|
17 | + ] |
|
18 | + ); |
|
19 | 19 | |
20 | - for ($i = 1; $i <= $dayMatches; $i++) { |
|
21 | - \App\Lib\DsManager\Models\Orm\MatchDay::create( |
|
22 | - [ |
|
23 | - 'league_id' => $league->id, |
|
24 | - 'day' => $i |
|
25 | - ] |
|
26 | - ); |
|
27 | - } |
|
28 | - } |
|
29 | - } |
|
20 | + for ($i = 1; $i <= $dayMatches; $i++) { |
|
21 | + \App\Lib\DsManager\Models\Orm\MatchDay::create( |
|
22 | + [ |
|
23 | + 'league_id' => $league->id, |
|
24 | + 'day' => $i |
|
25 | + ] |
|
26 | + ); |
|
27 | + } |
|
28 | + } |
|
29 | + } |
|
30 | 30 | } |
31 | 31 | \ No newline at end of file |