Files
usher-manage-stack/resources/views/member/create-profile.blade.php
Gbanyan 6890cf085d Fix 'My Membership' 404 by adding missing profile flow
- Added a 'Create Member Profile' page for existing users who don't have a member record.
- Updated MemberDashboardController to redirect to profile creation instead of aborting 404.
- Added 'member.profile.create' and 'member.profile.store' routes.
2025-11-28 00:25:04 +08:00

122 lines
7.6 KiB
PHP

<x-app-layout>
<x-slot name="header">
<h2 class="text-xl font-semibold leading-tight text-gray-800 dark:text-gray-200">
{{ __('Complete Your Membership Profile') }}
</h2>
</x-slot>
<div class="py-12">
<div class="mx-auto max-w-7xl sm:px-6 lg:px-8">
<div class="overflow-hidden bg-white shadow-sm sm:rounded-lg dark:bg-gray-800">
<div class="p-6 text-gray-900 dark:text-gray-100">
<div class="mb-6">
{{ __('To access the member area, please provide your membership details. This information is required for our records.') }}
</div>
<form method="POST" action="{{ route('member.profile.store') }}" class="space-y-6">
@csrf
{{-- Basic Information --}}
<div class="border-b border-gray-200 dark:border-gray-700 pb-4">
<h3 class="text-lg font-medium text-gray-900 dark:text-gray-100 mb-3">{{ __('Basic Information') }}</h3>
<!-- Full Name -->
<div>
<x-input-label for="full_name" :value="__('Full Name')" />
<x-text-input id="full_name" class="block mt-1 w-full" type="text" name="full_name" :value="old('full_name', Auth::user()->name)" required autofocus />
<x-input-error :messages="$errors->get('full_name')" class="mt-2" />
</div>
<!-- Phone -->
<div class="mt-4">
<x-input-label for="phone" :value="__('Phone')" />
<x-text-input id="phone" class="block mt-1 w-full" type="text" name="phone" :value="old('phone')" />
<x-input-error :messages="$errors->get('phone')" class="mt-2" />
</div>
<!-- National ID (Optional) -->
<div class="mt-4">
<x-input-label for="national_id" :value="__('National ID (Optional)')" />
<x-text-input id="national_id" class="block mt-1 w-full" type="text" name="national_id" :value="old('national_id')" maxlength="20" />
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400">{{ __('Your national ID will be encrypted for security.') }}</p>
<x-input-error :messages="$errors->get('national_id')" class="mt-2" />
</div>
</div>
{{-- Address Information --}}
<div class="border-b border-gray-200 dark:border-gray-700 pb-4">
<h3 class="text-lg font-medium text-gray-900 dark:text-gray-100 mb-3">{{ __('Address') }}</h3>
<!-- Address Line 1 -->
<div>
<x-input-label for="address_line_1" :value="__('Address Line 1')" />
<x-text-input id="address_line_1" class="block mt-1 w-full" type="text" name="address_line_1" :value="old('address_line_1')" />
<x-input-error :messages="$errors->get('address_line_1')" class="mt-2" />
</div>
<!-- Address Line 2 -->
<div class="mt-4">
<x-input-label for="address_line_2" :value="__('Address Line 2')" />
<x-text-input id="address_line_2" class="block mt-1 w-full" type="text" name="address_line_2" :value="old('address_line_2')" />
<x-input-error :messages="$errors->get('address_line_2')" class="mt-2" />
</div>
<div class="grid grid-cols-2 gap-4 mt-4">
<!-- City -->
<div>
<x-input-label for="city" :value="__('City')" />
<x-text-input id="city" class="block mt-1 w-full" type="text" name="city" :value="old('city')" />
<x-input-error :messages="$errors->get('city')" class="mt-2" />
</div>
<!-- Postal Code -->
<div>
<x-input-label for="postal_code" :value="__('Postal Code')" />
<x-text-input id="postal_code" class="block mt-1 w-full" type="text" name="postal_code" :value="old('postal_code')" />
<x-input-error :messages="$errors->get('postal_code')" class="mt-2" />
</div>
</div>
</div>
{{-- Emergency Contact --}}
<div class="border-b border-gray-200 dark:border-gray-700 pb-4">
<h3 class="text-lg font-medium text-gray-900 dark:text-gray-100 mb-3">{{ __('Emergency Contact') }}</h3>
<!-- Emergency Contact Name -->
<div>
<x-input-label for="emergency_contact_name" :value="__('Emergency Contact Name')" />
<x-text-input id="emergency_contact_name" class="block mt-1 w-full" type="text" name="emergency_contact_name" :value="old('emergency_contact_name')" />
<x-input-error :messages="$errors->get('emergency_contact_name')" class="mt-2" />
</div>
<!-- Emergency Contact Phone -->
<div class="mt-4">
<x-input-label for="emergency_contact_phone" :value="__('Emergency Contact Phone')" />
<x-text-input id="emergency_contact_phone" class="block mt-1 w-full" type="text" name="emergency_contact_phone" :value="old('emergency_contact_phone')" />
<x-input-error :messages="$errors->get('emergency_contact_phone')" class="mt-2" />
</div>
</div>
{{-- Terms and Conditions --}}
<div class="mt-4">
<label class="inline-flex items-center">
<input type="checkbox" name="terms_accepted" value="1" class="rounded border-gray-300 text-indigo-600 shadow-sm focus:ring-indigo-500 dark:border-gray-700 dark:bg-gray-900 dark:focus:ring-indigo-600 dark:focus:ring-offset-gray-800" {{ old('terms_accepted') ? 'checked' : '' }} required>
<span class="ml-2 text-sm text-gray-600 dark:text-gray-400">
{{ __('I accept the terms and conditions and agree to submit payment for membership activation.') }}
</span>
</label>
<x-input-error :messages="$errors->get('terms_accepted')" class="mt-2" />
</div>
<div class="flex items-center justify-end mt-6">
<x-primary-button>
{{ __('Complete Profile') }}
</x-primary-button>
</div>
</form>
</div>
</div>
</div>
</div>
</x-app-layout>