diff --git a/app/Country.php b/app/Country.php index 7b0ffb32..986e2430 100644 --- a/app/Country.php +++ b/app/Country.php @@ -3,9 +3,12 @@ namespace App; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Factories\HasFactory; class Country extends Model { + use HasFactory; + public $fillable = ['name', 'nami_id']; public $timestamps = false; diff --git a/app/Fee.php b/app/Fee.php index 0f5b8430..cb3843bf 100644 --- a/app/Fee.php +++ b/app/Fee.php @@ -3,9 +3,12 @@ namespace App; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Factories\HasFactory; class Fee extends Model { + use HasFactory; + public $fillable = ['name', 'nami_id']; public $timestamps = false; } diff --git a/database/factories/CountryFactory.php b/database/factories/CountryFactory.php new file mode 100644 index 00000000..e9cdba03 --- /dev/null +++ b/database/factories/CountryFactory.php @@ -0,0 +1,29 @@ +<?php + +namespace Database\Factories; + +use App\Country; +use Illuminate\Database\Eloquent\Factories\Factory; + +class CountryFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = Country::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition() + { + return [ + 'name' => $this->faker->country, + 'nami_id' => $this->faker->randomNumber(), + ]; + } +} diff --git a/database/factories/FeeFactory.php b/database/factories/FeeFactory.php new file mode 100644 index 00000000..91b4fd35 --- /dev/null +++ b/database/factories/FeeFactory.php @@ -0,0 +1,29 @@ +<?php + +namespace Database\Factories; + +use App\Fee; +use Illuminate\Database\Eloquent\Factories\Factory; + +class FeeFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = Fee::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition() + { + return [ + 'name' => $this->faker->randomElement(['Normaler Beitrag', 'Familienermäßigt']), + 'nami_id' => $this->faker->randomNumber(), + ]; + } +}