ignaaaam's avatar

Laravel Breeze, do I need guest layout?

Hi, i'm making a web app where there will be 4 types of users (users that wont register, user registered, subscriptors and admins). Since the start I've used laravel Breeze to set up the auth scaffolding, but I've seen that it generates a guest.blade.php aswell as GuestLayout.php component. Do I really need this guest thing? Because users that wont register and just visit the page wont have any role and I'm a bit confused because the guest.blade.php that breeze generates wont be used on my project. I'm fine with just having the app.blade.php to set all the layout and I would show things using guest, auth blade directives. But in the other hand I cant delete all this guest thing that Breeze generates. I dont know i'm a bit confused about that. I feel like I just dont need all this guest thing but Breeze is forcing me to use it.

Hope someone can clarify this a bit and help me. Thanks a lot!

0 likes
8 replies
Snapey's avatar

just delete the views you don't use

1 like
tykus's avatar
tykus
Best Answer
Level 104

@ignaaaam that is the GuestLayout component - you can delete that too if you have determined that you don't need the layout.

Before you do, search your project for x-guest-layout because there are a number of Breeze's view that use it, such as Login, Password Reset, Verify Email etc etc.

2 likes
kokoshneta's avatar

@ignaaaam You should change it to whatever makes sense in your app – or delete it altogether.

It’s just a Blade component that contains a basic layout for you to inject various elements into, nothing more. You can use it or get rid of it and use your own exactly as you please.

1 like
Snapey's avatar

@ignaaaam don't stress it. Remove the things that you don't need, or just leave them be - it makes 0.0000001% difference to the maintainability of your app.

2 likes
tykus's avatar

@ignaaaam the default x-app-layout template expects an authenticated user, which you will not have available in the login, password reset contexts

1 like
ignaaaam's avatar

@tykus Yeah so I guess the best thing would be to wrap that authenticated user in a @auth directive or maybe just get rid of it. Thanks a lot for the answers I'll just go from there and tweak all what I need. My main problem seems solved now. Thanks a lot really. Amazing community.

1 like

Please or to participate in this conversation.