This episode is for members only

Sign up to access "Build a Starter Kit With Inertia and Fortify" right now.

Get started
Already a member? Sign in to continue
Playing
36. Adding a verification notice

Episodes

0%
Your progress
  • Total: 5h 21m
  • Played: 0m
  • Remaining: 5h 21m
Join or sign in to track your progress

Transcript

00:00
OK, so once again, we can solve this issue where we don't have a route defined by creating out a modal and going ahead
00:08
and adding this to our Fortify service provider and then moving the route over like we've done a few times already. So let's get started on this by going over to our Fortify service provider. And we're going to go ahead and use Fortify again here.
00:23
And this time we are looking for the verify email view. So this is going to work in exactly the same way. And again, we're going to need that controller because that controller returns the response, which is responsible
00:36
for hooking this up to the container and then running what is inside of this closure. So we're going to do exactly the same thing again. And let's go ahead and just choose a name for this. Let's call this verify email.
00:48
And we'll go ahead and create this verify email modal out. And of course, it doesn't need to be a modal. You could choose pretty much anything. So let's go ahead and create verify email
00:57
view, and again, we'll just copy this from somewhere else. So let's choose the confirm password one. Let's pop this in here. And we're not going to have a continue button that is going to become
01:09
the button which triggers the recent of the email. So I'm going to change the title here to verify your email. And let's go ahead and get rid of this field because we're definitely not going to need that.
01:21
We will need a form and let's just say verify your email. OK, so we'll just keep it like that. Let's get rid of this form because we're not going to need to post anything down here and we can get rid of the use modal stuff as well.
01:36
OK, so now that we've got our form, let's go and just try this again. And we already know that we need to define the route here. So this still isn't going to work. So once again, let's head over to our fortify routes.
01:48
Let's find our confirm email or confirm. See what it's called. Let's just have a search down here and we should see it might be email verification. So let's say, yeah, let's have a look here.
02:05
And we yeah, so we've got this verification notice again wrapped in our enable views. So we're going to move that over to our fortify routes so this can be used and once again, we're going to need to make sure to pull this control room before we forget and make sure that this is only
02:22
enabled if this feature is enabled, so this route is registered if the feature is enabled, so we should be good if we head over now and click on our dashboard. We see our modal. Great. So that's that. So really simple to do.
02:36
Let's just go ahead and finish off the verify email here. We're going to go ahead and say resend email and we'll get rid of this because we're not quite sure what we're doing here yet. And let's go ahead and add in a little notice in here.
02:51
So I've already got some copy in here that I can just pull over and that you'll need to verify your email before accessing that and we'll just set the text to small. So let's head over and check this out. And yeah, that's not working.
03:05
Let's get rid of the disabled part of this because we're not too sure what we're doing with this just yet. In fact, let's bring back our form. So we'll go ahead and bring our form back in there.
03:19
We might be able to use that. So let's say use form and we'll just put an empty object in there for now. OK, so there we go. We've got when we click on dashboard, verify your email.
03:29
And of course, clicking this button will resend the email. So now that we've done that again and we've replaced out this view with a modal, let's head over to the next episode and figure out how we can click this to resend an email if the user didn't receive one.
40 episodes5 hrs 21 mins

Overview

Let’s build our own Laravel starter kit with Inertia and include all the features you’d expect. We’ll implement authentication, email verification, profile photo uploads, two factor authentication, and more.

Fortify is a frontend agnostic authentication package for Laravel, meaning most of the work is done for us — we just need to build the frontend and make requests to the endpoints that Fortify registers.

Once you’re done, you’ll have a clean slate for building your next project, with the ability to control everything in your own starter kit.

Alex Garrett-Smith
Alex Garrett-Smith
Hey, I'm the founder of Codecourse!

Comments

No comments, yet. Be the first to leave a comment.