Call the AwardListener in the proper UserStatsChanged event #155

This commit is contained in:
Nabeel Shahzad
2018-03-17 12:55:50 -05:00
parent 3c39aeee43
commit 67ef6872af
6 changed files with 90 additions and 12 deletions

View File

@@ -0,0 +1,13 @@
<?php
use Faker\Generator as Faker;
$factory->define(App\Models\Award::class, function (Faker $faker) {
return [
'id' => null,
'name' => $faker->name,
'description' => $faker->text(10),
'ref_class' => null,
'ref_class_params' => null,
];
});

View File

@@ -29,6 +29,16 @@ class CreateAwardsTable extends Migration
$table->index(['ref_class']);
});
Schema::create('user_awards', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('user_id');
$table->unsignedInteger('award_id');
$table->timestamps();
$table->index(['user_id', 'award_id']);
});
}
/**
@@ -39,5 +49,6 @@ class CreateAwardsTable extends Migration
public function down()
{
Schema::dropIfExists('awards');
Schema::dropIfExists('user_awards');
}
}