diff --git a/app/Models/User.php b/app/Models/User.php index 49e2dee..e5e826a 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -113,6 +113,11 @@ private function getBirthdayFromIdCard(): string return $year . '-' . $month . '-' . $day; } + public function isAdult(): bool + { + return $this->birthday_at->diffInYears(now()) >= 18; + } + public function user_group(): BelongsTo { return $this->belongsTo(UserGroup::class); diff --git a/resources/views/real_name/create.blade.php b/resources/views/real_name/create.blade.php index f6d817c..f09f16a 100644 --- a/resources/views/real_name/create.blade.php +++ b/resources/views/real_name/create.blade.php @@ -5,17 +5,9 @@ @php($user = auth('web')->user()) @if ($user->real_name_verified_at) -