Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Ligonsker's avatar

Breeze put "require" statement in the middle of web.php

I installed Breeze with Blade and it put the following code in web.php:

Route::get('/', function () {
    return view('welcome');
});

Route::get('/dashboard', function () {
    return view('dashboard');
})->middleware(['auth', 'verified'])->name('dashboard');

require __DIR__.'/auth.php';

is the require __DIR__.'/auth.php'; line supposed to be there?

The app was not clean, I actually did write some stuff earlier in web.php and forgot to remove them (had a few extra routes there)

0 likes
2 replies
aknEvrnky's avatar
Level 10

Breeze is a starter kit, you should not install it after you start building something. Because it will overwrite and publish its own files.

And yes, the require __DIR__.'/auth.php'; is implemented by breeze. It includes login, register, etc. routes. You may use them or just delete if you do not need.

If you want to use auth routes but not like 'require' method, you may register the auth.php file in RouteServiceProvider which is more laravel way.

1 like
Ligonsker's avatar

@aknEvrnky Oh YES! I just realized it added another file (auth.php) to /routes. I guess it took VSCode time to update the change, thank you! (And if I read the docs better, I would've seen it added that 😅)

Yes I know it overwrites stuff I just didn't care about them but thought it might interfere with properly installing Breeze. If it just overwrites everything I don't mind, but still I made a clean Laravel installation just in case

1 like

Please or to participate in this conversation.