diff --git a/app/Http/Livewire/Associates/Auth/Register.php b/app/Http/Livewire/Associates/Auth/Register.php index 71cf3ad..a5e7da8 100644 --- a/app/Http/Livewire/Associates/Auth/Register.php +++ b/app/Http/Livewire/Associates/Auth/Register.php @@ -65,6 +65,9 @@ class Register extends Component /** @var int */ public $contribution = null; + /** @var string */ + public $form; + protected function rules($partial = false) { $rules = [ @@ -107,6 +110,11 @@ class Register extends Component return $rules; } + public function mount($form = 'individual') + { + $this->form = $form; + } + public function updated($field) { $this->validateOnly($field, collect($this->rules(true))); diff --git a/resources/views/livewire/associates/auth/register.blade.php b/resources/views/livewire/associates/auth/register.blade.php index 10a3fff..2404ccd 100644 --- a/resources/views/livewire/associates/auth/register.blade.php +++ b/resources/views/livewire/associates/auth/register.blade.php @@ -18,7 +18,7 @@
- @include('livewire.associates.partials.forms.individual') + @include('livewire.associates.partials.forms.' . $form)
diff --git a/routes/web.php b/routes/web.php index 5271147..4333689 100644 --- a/routes/web.php +++ b/routes/web.php @@ -16,7 +16,9 @@ use Illuminate\Support\Facades\Route; Route::middleware('guest')->group(function () { Route::view('login', 'associates.auth.login')->name('login'); - Route::view('register/{form?}', 'associates.auth.register')->name('register'); + Route::livewire('register/{form?}', 'associates.auth.register') + ->layout('layouts.auth') + ->name('register'); }); Route::view('password/reset', 'associates.auth.passwords.email')->name('password.request');