Set default country

This commit is contained in:
philipp lang 2021-06-22 23:00:27 +02:00
parent f7066549d1
commit 78f3d060ba
2 changed files with 7 additions and 1 deletions

View File

@ -11,5 +11,9 @@ class Country extends Model
public $fillable = ['name', 'nami_id'];
public static function default(): int {
return self::whereName('Deutschland')->firstOrFail()->id;
}
public $timestamps = false;
}

View File

@ -37,7 +37,9 @@ class MemberController extends Controller
'nationalities' => Nationality::get()->pluck('name', 'id'),
'confessions' => Confession::where('is_null', false)->get()->pluck('name', 'id'),
'fees' => Fee::get()->pluck('name', 'id'),
'data' => null,
'data' => [
'country_id' => Country::default()
],
'mode' => 'create',
]);
}