guarded instead of fillable

This commit is contained in:
Benjamin Takats
2022-12-01 16:01:24 +01:00
parent 4699805e60
commit 470e9c68b8
37 changed files with 120 additions and 197 deletions

View File

@@ -26,6 +26,7 @@ class CityFactory extends Factory
return [
'country_id' => Country::factory(),
'name' => $this->faker->name,
'slug' => $this->faker->slug,
];
}
}

View File

@@ -19,6 +19,7 @@ class CreateCitiesTable extends Migration
$table->id();
$table->foreignId('country_id')->constrained()->cascadeOnDelete()->cascadeOnUpdate();
$table->string('name');
$table->string('slug')->unique();
$table->timestamps();
});

View File

@@ -59,14 +59,17 @@ class DatabaseSeeder extends Seeder
City::create([
'country_id' => 1,
'name' => 'Füssen',
'slug' => str('Füssen')->slug('-', 'de'),
]);
City::create([
'country_id' => 2,
'name' => 'Wien',
'slug' => str('Wien')->slug('-', 'de'),
]);
City::create([
'country_id' => 3,
'name' => 'Zürich',
'slug' => str('Zürich')->slug('-', 'de'),
]);
Venue::create([
'city_id' => 1,