@@ -13,6 +13,6 @@ |
||
| 13 | 13 | | |
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | -Artisan::command('inspire', function () { |
|
| 16 | +Artisan::command('inspire', function() { |
|
| 17 | 17 | $this->comment(Inspiring::quote()); |
| 18 | 18 | })->describe('Display an inspiring quote'); |
@@ -13,6 +13,6 @@ |
||
| 13 | 13 | | |
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | -Route::middleware('auth:api')->get('/user', function (Request $request) { |
|
| 16 | +Route::middleware('auth:api')->get('/user', function(Request $request) { |
|
| 17 | 17 | return $request->user(); |
| 18 | 18 | }); |
@@ -11,6 +11,6 @@ |
||
| 11 | 11 | | |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | -Broadcast::channel('App.User.{id}', function ($user, $id) { |
|
| 14 | +Broadcast::channel('App.User.{id}', function($user, $id) { |
|
| 15 | 15 | return (int) $user->id === (int) $id; |
| 16 | 16 | }); |
@@ -23,10 +23,10 @@ |
||
| 23 | 23 | $table->timestamps(); |
| 24 | 24 | |
| 25 | 25 | $table->foreign('question_id') |
| 26 | - ->references('id') |
|
| 27 | - ->on('quiz_questions') |
|
| 28 | - ->onDelete('cascade') |
|
| 29 | - ->onUpdate('cascade'); |
|
| 26 | + ->references('id') |
|
| 27 | + ->on('quiz_questions') |
|
| 28 | + ->onDelete('cascade') |
|
| 29 | + ->onUpdate('cascade'); |
|
| 30 | 30 | }); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | { |
| 16 | 16 | if (Schema::hasTable('question_choices')) return; |
| 17 | 17 | |
| 18 | - Schema::create('question_choices', function (Blueprint $table) { |
|
| 18 | + Schema::create('question_choices', function(Blueprint $table) { |
|
| 19 | 19 | $table->increments('id'); |
| 20 | 20 | $table->integer('question_id')->unsigned()->index(); |
| 21 | 21 | $table->enum('is_right_choice', [0, 1])->nullable(); |
@@ -13,7 +13,9 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - if (Schema::hasTable('question_choices')) return; |
|
| 16 | + if (Schema::hasTable('question_choices')) { |
|
| 17 | + return; |
|
| 18 | + } |
|
| 17 | 19 | |
| 18 | 20 | Schema::create('question_choices', function (Blueprint $table) { |
| 19 | 21 | $table->increments('id'); |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | { |
| 16 | 16 | if (Schema::hasTable('quizzes')) return; |
| 17 | 17 | |
| 18 | - Schema::create('quizzes', function (Blueprint $table) { |
|
| 18 | + Schema::create('quizzes', function(Blueprint $table) { |
|
| 19 | 19 | $table->increments('id'); |
| 20 | 20 | $table->string('quiz_name', 80); |
| 21 | 21 | $table->text('quiz_description'); |
@@ -13,7 +13,9 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - if (Schema::hasTable('quizzes')) return; |
|
| 16 | + if (Schema::hasTable('quizzes')) { |
|
| 17 | + return; |
|
| 18 | + } |
|
| 17 | 19 | |
| 18 | 20 | Schema::create('quizzes', function (Blueprint $table) { |
| 19 | 21 | $table->increments('id'); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('users', function (Blueprint $table) { |
|
| 16 | + Schema::create('users', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->string('username'); |
| 19 | 19 | $table->string('email')->unique(); |
@@ -21,16 +21,16 @@ |
||
| 21 | 21 | $table->timestamps(); |
| 22 | 22 | |
| 23 | 23 | $table->foreign('user_id') |
| 24 | - ->references('id') |
|
| 25 | - ->on('users') |
|
| 26 | - ->onDelete('cascade') |
|
| 27 | - ->onUpdate('cascade'); |
|
| 24 | + ->references('id') |
|
| 25 | + ->on('users') |
|
| 26 | + ->onDelete('cascade') |
|
| 27 | + ->onUpdate('cascade'); |
|
| 28 | 28 | |
| 29 | 29 | $table->foreign('quiz_id') |
| 30 | - ->references('id') |
|
| 31 | - ->on('quizzes') |
|
| 32 | - ->onDelete('cascade') |
|
| 33 | - ->onUpdate('cascade'); |
|
| 30 | + ->references('id') |
|
| 31 | + ->on('quizzes') |
|
| 32 | + ->onDelete('cascade') |
|
| 33 | + ->onUpdate('cascade'); |
|
| 34 | 34 | }); |
| 35 | 35 | } |
| 36 | 36 | |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | { |
| 16 | 16 | if (Schema::hasTable('user_quizzes')) return; |
| 17 | 17 | |
| 18 | - Schema::create('user_quizzes', function (Blueprint $table) { |
|
| 18 | + Schema::create('user_quizzes', function(Blueprint $table) { |
|
| 19 | 19 | $table->integer('user_id')->unsigned()->index(); |
| 20 | 20 | $table->integer('quiz_id')->unsigned()->index(); |
| 21 | 21 | $table->timestamps(); |
@@ -13,7 +13,9 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - if (Schema::hasTable('user_quizzes')) return; |
|
| 16 | + if (Schema::hasTable('user_quizzes')) { |
|
| 17 | + return; |
|
| 18 | + } |
|
| 17 | 19 | |
| 18 | 20 | Schema::create('user_quizzes', function (Blueprint $table) { |
| 19 | 21 | $table->integer('user_id')->unsigned()->index(); |
@@ -23,10 +23,10 @@ |
||
| 23 | 23 | $table->timestamps(); |
| 24 | 24 | |
| 25 | 25 | $table->foreign('user_id') |
| 26 | - ->references('id') |
|
| 27 | - ->on('users') |
|
| 28 | - ->onDelete('cascade') |
|
| 29 | - ->onUpdate('cascade'); |
|
| 26 | + ->references('id') |
|
| 27 | + ->on('users') |
|
| 28 | + ->onDelete('cascade') |
|
| 29 | + ->onUpdate('cascade'); |
|
| 30 | 30 | }); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | { |
| 16 | 16 | if (Schema::hasTable('activations')) return; |
| 17 | 17 | |
| 18 | - Schema::create('activations', function (Blueprint $table) { |
|
| 18 | + Schema::create('activations', function(Blueprint $table) { |
|
| 19 | 19 | $table->increments('id'); |
| 20 | 20 | $table->integer('user_id')->unsigned()->index(); |
| 21 | 21 | $table->string('token'); |
@@ -13,7 +13,9 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - if (Schema::hasTable('activations')) return; |
|
| 16 | + if (Schema::hasTable('activations')) { |
|
| 17 | + return; |
|
| 18 | + } |
|
| 17 | 19 | |
| 18 | 20 | Schema::create('activations', function (Blueprint $table) { |
| 19 | 21 | $table->increments('id'); |
@@ -25,22 +25,22 @@ |
||
| 25 | 25 | $table->timestamps(); |
| 26 | 26 | |
| 27 | 27 | $table->foreign('user_id') |
| 28 | - ->references('id') |
|
| 29 | - ->on('users') |
|
| 30 | - ->onDelete('cascade') |
|
| 31 | - ->onUpdate('cascade'); |
|
| 28 | + ->references('id') |
|
| 29 | + ->on('users') |
|
| 30 | + ->onDelete('cascade') |
|
| 31 | + ->onUpdate('cascade'); |
|
| 32 | 32 | |
| 33 | 33 | $table->foreign('question_id') |
| 34 | - ->references('id') |
|
| 35 | - ->on('quiz_questions') |
|
| 36 | - ->onDelete('cascade') |
|
| 37 | - ->onUpdate('cascade'); |
|
| 34 | + ->references('id') |
|
| 35 | + ->on('quiz_questions') |
|
| 36 | + ->onDelete('cascade') |
|
| 37 | + ->onUpdate('cascade'); |
|
| 38 | 38 | |
| 39 | 39 | $table->foreign('question_choice_id') |
| 40 | - ->references('id') |
|
| 41 | - ->on('question_choices') |
|
| 42 | - ->onDelete('cascade') |
|
| 43 | - ->onUpdate('cascade'); |
|
| 40 | + ->references('id') |
|
| 41 | + ->on('question_choices') |
|
| 42 | + ->onDelete('cascade') |
|
| 43 | + ->onUpdate('cascade'); |
|
| 44 | 44 | }); |
| 45 | 45 | } |
| 46 | 46 | |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | { |
| 16 | 16 | if (Schema::hasTable('user_question_answer')) return; |
| 17 | 17 | |
| 18 | - Schema::create('user_question_answer', function (Blueprint $table) { |
|
| 18 | + Schema::create('user_question_answer', function(Blueprint $table) { |
|
| 19 | 19 | $table->increments('id'); |
| 20 | 20 | $table->integer('user_id')->unsigned()->index(); |
| 21 | 21 | $table->integer('question_id')->unsigned()->index(); |
@@ -13,7 +13,9 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - if (Schema::hasTable('user_question_answer')) return; |
|
| 16 | + if (Schema::hasTable('user_question_answer')) { |
|
| 17 | + return; |
|
| 18 | + } |
|
| 17 | 19 | |
| 18 | 20 | Schema::create('user_question_answer', function (Blueprint $table) { |
| 19 | 21 | $table->increments('id'); |