seeder wip
This commit is contained in:
1 parent
1d16946f20
commit
005924ef8a
34 files changed
+286
-325
No files matched your search
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Konto;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Auftraggeber>
|
||||
*/
|
||||
class AuftraggeberFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'konto_id' => Konto::all()->random()->id,
|
||||
'name' => fake()->name(),
|
||||
'address' => fake()->Address(),
|
||||
'kontakt' => fake()->name(),
|
||||
'country' => 'Österreich',
|
||||
'email' => fake()->email(),
|
||||
'phone' => fake()->PhoneNumber(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Konto;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
@@ -17,7 +18,7 @@ class GutachterFactory extends Factory
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'konto_id' => fake()->numberBetween(1, 7),
|
||||
'konto_id' => Konto::all()->random()->id,
|
||||
'name' => fake()->name(),
|
||||
'address' => fake()->Address(),
|
||||
'country' => 'Österreich',
|
||||
|
||||
@@ -26,7 +26,6 @@ class KontoFactory extends Factory
|
||||
'country' => 'Österreich',
|
||||
'phone' => fake()->PhoneNumber(),
|
||||
'uid_number' => 'ATU'.fake()->randomNumber(8, true),
|
||||
'agb_akzeptiert' => 1,
|
||||
'plan_id' => fake()->numberBetween(1, 3),
|
||||
'guthaben' => fake()->numberBetween(4, 50),
|
||||
'gueltig_bis' => fake()->dateTimeBetween('-1 month', '+5 month'),
|
||||
|
||||
@@ -32,6 +32,7 @@ class UserFactory extends Factory
|
||||
'email_verified_at' => now(),
|
||||
'password' => static::$password ??= Hash::make('password'),
|
||||
'remember_token' => Str::random(10),
|
||||
'agb_akzeptiert' => 1,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user