#22 - wip
This commit is contained in:
@@ -8,15 +8,8 @@ use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
class VacationFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
@@ -7,6 +7,7 @@ use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Toby\Eloquent\Models\User;
|
||||
use Toby\Eloquent\Models\VacationRequest;
|
||||
use Toby\Eloquent\Models\YearPeriod;
|
||||
|
||||
return new class() extends Migration {
|
||||
public function up(): void
|
||||
@@ -15,6 +16,7 @@ return new class() extends Migration {
|
||||
$table->id();
|
||||
$table->foreignIdFor(User::class)->constrained()->cascadeOnDelete();
|
||||
$table->foreignIdFor(VacationRequest::class)->constrained()->cascadeOnDelete();
|
||||
$table->foreignIdFor(YearPeriod::class)->constrained()->cascadeOnDelete();
|
||||
$table->date("date");
|
||||
});
|
||||
}
|
||||
|
@@ -91,6 +91,7 @@ class DatabaseSeeder extends Seeder
|
||||
$vacationRequest->vacations()->create([
|
||||
"date" => $day,
|
||||
"user_id" => $vacationRequest->user->id,
|
||||
"year_period_id" => $vacationRequest->yearPeriod->id,
|
||||
]);
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user