Call the AwardListener in the proper UserStatsChanged event #155
This commit is contained in:
13
app/Database/factories/AwardsFactory.php
Normal file
13
app/Database/factories/AwardsFactory.php
Normal 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,
|
||||
];
|
||||
});
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user