@@ -4,7 +4,7 @@ |
||
4 | 4 | use Xoco70\KendoTournaments\Models\Championship; |
5 | 5 | use Xoco70\KendoTournaments\Models\ChampionshipSettings; |
6 | 6 | |
7 | -$factory->define(ChampionshipSettings::class, function (Faker\Generator $faker) use ($factory) { |
|
7 | +$factory->define(ChampionshipSettings::class, function(Faker\Generator $faker) use ($factory) { |
|
8 | 8 | $tcs = Championship::all()->pluck('id')->toArray(); |
9 | 9 | |
10 | 10 | return [ |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('sessions', function (Blueprint $table) { |
|
16 | + Schema::create('sessions', function(Blueprint $table) { |
|
17 | 17 | $table->string('id')->unique(); |
18 | 18 | $table->integer('user_id')->nullable(); |
19 | 19 | $table->string('ip_address', 45)->nullable(); |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -$factory->define(\Illuminate\Foundation\Auth\User::class, function (Faker\Generator $faker) { |
|
4 | +$factory->define(\Illuminate\Foundation\Auth\User::class, function(Faker\Generator $faker) { |
|
5 | 5 | $email = $faker->email; |
6 | 6 | |
7 | 7 | return [ |
@@ -4,7 +4,7 @@ |
||
4 | 4 | use Xoco70\KendoTournaments\Models\Tournament; |
5 | 5 | use Xoco70\KendoTournaments\Models\Venue; |
6 | 6 | |
7 | -$factory->define(Tournament::class, function (Faker\Generator $faker) { |
|
7 | +$factory->define(Tournament::class, function(Faker\Generator $faker) { |
|
8 | 8 | $users = User::all()->pluck('id')->toArray(); |
9 | 9 | if (count($users) == 0) { |
10 | 10 | $user = factory(\Illuminate\Foundation\Auth\User::class)->create(); |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | use Xoco70\KendoTournaments\Models\Venue; |
4 | 4 | |
5 | -$factory->define(Venue::class, function (Faker\Generator $faker) { |
|
5 | +$factory->define(Venue::class, function(Faker\Generator $faker) { |
|
6 | 6 | return [ |
7 | 7 | 'venue_name' => $faker->colorName, |
8 | 8 | 'address' => $faker->streetName, |
@@ -8,7 +8,7 @@ |
||
8 | 8 | { |
9 | 9 | public function up() |
10 | 10 | { |
11 | - Schema::create('tournament', function (Blueprint $table) { |
|
11 | + Schema::create('tournament', function(Blueprint $table) { |
|
12 | 12 | $table->increments('id'); |
13 | 13 | $table->Integer('user_id')->unsigned()->index(); |
14 | 14 | $table->foreign('user_id') |
@@ -12,7 +12,7 @@ |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('venue', function (Blueprint $table) { |
|
15 | + Schema::create('venue', function(Blueprint $table) { |
|
16 | 16 | $table->increments('id'); |
17 | 17 | $table->string('venue_name'); |
18 | 18 | $table->string('address')->nullable(); |
@@ -23,11 +23,11 @@ |
||
23 | 23 | { |
24 | 24 | parent::boot(); |
25 | 25 | |
26 | - static::deleting(function ($championship) { |
|
26 | + static::deleting(function($championship) { |
|
27 | 27 | $championship->competitors()->delete(); |
28 | 28 | $championship->settings()->delete(); |
29 | 29 | }); |
30 | - static::restoring(function ($championship) { |
|
30 | + static::restoring(function($championship) { |
|
31 | 31 | $championship->competitors()->restore(); |
32 | 32 | $championship->settings()->restore(); |
33 | 33 | }); |
@@ -169,8 +169,9 @@ |
||
169 | 169 | |
170 | 170 | public function buildName() |
171 | 171 | { |
172 | - if ($this->settings != null && $this->settings->alias != null) |
|
173 | - return $this->settings->alias; |
|
172 | + if ($this->settings != null && $this->settings->alias != null) { |
|
173 | + return $this->settings->alias; |
|
174 | + } |
|
174 | 175 | |
175 | 176 | if ($this->hasNoCustomSettings()) { |
176 | 177 | return $this->category->name; |
@@ -56,13 +56,13 @@ |
||
56 | 56 | protected static function boot() |
57 | 57 | { |
58 | 58 | parent::boot(); |
59 | - static::deleting(function ($tournament) { |
|
59 | + static::deleting(function($tournament) { |
|
60 | 60 | foreach ($tournament->championships as $ct) { |
61 | 61 | $ct->delete(); |
62 | 62 | } |
63 | 63 | $tournament->invites()->delete(); |
64 | 64 | }); |
65 | - static::restoring(function ($tournament) { |
|
65 | + static::restoring(function($tournament) { |
|
66 | 66 | foreach ($tournament->championships()->withTrashed()->get() as $ct) { |
67 | 67 | $ct->restore(); |
68 | 68 | } |