0
0
Laravelframework~10 mins

Registration flow in Laravel - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a registration route in Laravel.

Laravel
Route::[1]('/register', [RegisterController::class, 'showRegistrationForm']);
Drag options to blanks, or click blank then click option'
Apost
Bput
Cget
Ddelete
Attempts:
3 left
💡 Hint
Common Mistakes
Using POST instead of GET to show the form.
Using PUT or DELETE which are for updating or deleting data.
2fill in blank
medium

Complete the code to handle the registration form submission.

Laravel
Route::[1]('/register', [RegisterController::class, 'register']);
Drag options to blanks, or click blank then click option'
Apost
Bpatch
Cdelete
Dget
Attempts:
3 left
💡 Hint
Common Mistakes
Using GET instead of POST for form submission.
Using PATCH or DELETE which are for updates or deletions.
3fill in blank
hard

Fix the error in the validation rules for the registration form.

Laravel
$request->validate([ 'email' => 'required|email|unique:users,[1]' ]);
Drag options to blanks, or click blank then click option'
Aemail
Busername
Cpassword
Did
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'username' or 'password' instead of 'email' in the unique rule.
Using 'id' which is not the email column.
4fill in blank
hard

Fill both blanks to hash the password and save the user.

Laravel
$user = new User();
$user->email = $request->email;
$user->password = [1]($request->password);
$user->[2]();
Drag options to blanks, or click blank then click option'
AHash::make
Bbcrypt
Csave
Dcreate
Attempts:
3 left
💡 Hint
Common Mistakes
Using bcrypt directly without the Hash facade.
Using create() on an instance instead of save().
5fill in blank
hard

Fill all three blanks to redirect the user after registration with a success message.

Laravel
return redirect()->[1]('home')->with('[2]', '[3]');
Drag options to blanks, or click blank then click option'
Aroute
Bhome
Csuccess
DYou have registered successfully!
Attempts:
3 left
💡 Hint
Common Mistakes
Using redirect()->home() instead of route('home').
Passing the message as the key instead of the value.