#23 - ecs fix
This commit is contained in:
@@ -11,7 +11,7 @@ use Toby\Models\YearPeriod;
|
||||
return new class() extends Migration {
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('vacation_limits', function (Blueprint $table): void {
|
||||
Schema::create("vacation_limits", function (Blueprint $table): void {
|
||||
$table->id();
|
||||
$table->foreignIdFor(User::class)->constrained()->cascadeOnDelete();
|
||||
$table->foreignIdFor(YearPeriod::class)->constrained()->cascadeOnDelete();
|
||||
@@ -23,6 +23,6 @@ return new class() extends Migration {
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('vacation_limits');
|
||||
Schema::dropIfExists("vacation_limits");
|
||||
}
|
||||
};
|
||||
|
@@ -14,8 +14,9 @@ use Toby\Models\YearPeriod;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
public function __construct(protected UserAvatarGenerator $avatarGenerator)
|
||||
{
|
||||
public function __construct(
|
||||
protected UserAvatarGenerator $avatarGenerator,
|
||||
) {
|
||||
}
|
||||
|
||||
public function run(): void
|
||||
@@ -23,7 +24,7 @@ class DatabaseSeeder extends Seeder
|
||||
User::unsetEventDispatcher();
|
||||
YearPeriod::unsetEventDispatcher();
|
||||
|
||||
User::factory(14)->create();
|
||||
User::factory(9)->create();
|
||||
User::factory([
|
||||
"email" => env("LOCAL_EMAIL_FOR_LOGIN_VIA_GOOGLE"),
|
||||
])->create();
|
||||
@@ -35,11 +36,17 @@ class DatabaseSeeder extends Seeder
|
||||
YearPeriod::factory()
|
||||
->count(3)
|
||||
->sequence(
|
||||
["year" => Carbon::now()->year - 1],
|
||||
["year" => Carbon::now()->year],
|
||||
["year" => Carbon::now()->year + 1],
|
||||
[
|
||||
"year" => Carbon::now()->year - 1,
|
||||
],
|
||||
[
|
||||
"year" => Carbon::now()->year,
|
||||
],
|
||||
[
|
||||
"year" => Carbon::now()->year + 1,
|
||||
],
|
||||
)
|
||||
->afterCreating(function (YearPeriod $yearPeriod) use ($users) {
|
||||
->afterCreating(function (YearPeriod $yearPeriod) use ($users): void {
|
||||
foreach ($users as $user) {
|
||||
VacationLimit::factory()
|
||||
->for($yearPeriod)
|
||||
@@ -47,7 +54,7 @@ class DatabaseSeeder extends Seeder
|
||||
->create();
|
||||
}
|
||||
})
|
||||
->create();
|
||||
->create();
|
||||
}
|
||||
|
||||
protected function generateAvatarsForUsers(Collection $users): void
|
||||
|
Reference in New Issue
Block a user