Where is Register Controller located? Laravel 8 (Jetstream+Livewire) i want to add select option in my register.blade.php which the select option value is from database
so, i want to add some like
$roles = Role::get();
return view('auth.register', compact('roles'));
so in my register.blade.php i can do
<x-guest-layout>
<x-jet-authentication-card>
<x-slot name="logo">
<x-jet-authentication-card-logo />
</x-slot>
<x-jet-validation-errors class="mb-4" />
<form method="POST" action="{{ route('register') }}">
@csrf
<div>
<select name="role" id="role">
@foreach($roles as $fr)
<option value="{{ $fr->id }}">{{ $fr->name }}</option>
@endforeach
</select>
</div>
<div>
<x-jet-label for="name" value="{{ __('Name') }}" />
<x-jet-input id="name" class="block mt-1 w-full" type="text" name="name" :value="old('name')" required autofocus autocomplete="name" />
</div>
<div class="mt-4">
<x-jet-label for="email" value="{{ __('Email') }}" />
<x-jet-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required />
</div>
<div class="mt-4">
<x-jet-label for="password" value="{{ __('Password') }}" />
<x-jet-input id="password" class="block mt-1 w-full" type="password" name="password" required autocomplete="new-password" />
</div>
<div class="mt-4">
<x-jet-label for="password_confirmation" value="{{ __('Confirm Password') }}" />
<x-jet-input id="password_confirmation" class="block mt-1 w-full" type="password" name="password_confirmation" required autocomplete="new-password" />
</div>
<div class="flex items-center justify-end mt-4">
<a class="underline text-sm text-gray-600 hover:text-gray-900" href="{{ route('login') }}">
{{ __('Already registered?') }}
</a>
<x-jet-button class="ml-4">
{{ __('Register') }}
</x-jet-button>
</div>
</form>
</x-jet-authentication-card>
</x-guest-layout>
nah i dont know where is the position of RegisterController.php located,
from memory, its in /vendor/laravel/jetstream/src/Http/controllers
or in fortify, I cant remember. The point is, you cannot change it. You have to bring it to your app space and create a new register route to use it instead of jetstream boilerplate
If you have not got too far, consider starting again with Laravel/breeze
ow ok thanks! i will re-create my project
btw its possible to me for using laravel 8 but with laravel 7 authentication like composer require laravel/ui > php artisan ui vue --auth ?
yes you can use laravel/ui for bootstrap, or laravel/breeze (released yesterday) for tailwind
@rarepyre You can take a look at this file app\Actions\Fortify\CreateNewUser. You can add your custom attributes and don't forget to update the $fillable = [] property of your model to include the new attributes
Please sign in or create an account to participate in this conversation.