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

prenna's avatar

My Modified Basic Laravel 5.3 Auth Installation - Feedback

Hi all. I have modified the basic auth setup in a way which I think makes more sense for starting an app with a website. If you have the time, please read my readme below. I would love to know if it makes sense, and if you would like to try it out for 2 mins, I can make it available. (I'm using Cloud9 so it is only live for short periods of time as it's for development purposes, not production hosting.) If somebody wants to be really kind, I would love to know how I can configure a standard laravel installation to produce this setup when using the php artisan make:auth command. Thanks

Laravel 5.3 with Modified Auth and App Routing

I always find that I want to build an app (requires login) with a website to advertise the app. So I modified the basic Laravel installation in a way that I think makes more sense for this purpose.

Views

Views are organised within 'app' and 'web' subfolders, each having their own 'layouts', 'meta', and 'includes' folders.

  • /home now returns the web.home view as it makes more sense to me for the 'Home' page to be for the website and not the app. I usually use this in place of the 'welcome' view but I have left that for people that like to use welcome and home for different purposes. I have also left the routes for each in the web routes file.
  • The welcome view has auth links, and a link to Home, but web.home does not. (This is personal preference. The Laravel title on the web.home view also links back to '/'.)

Meta and Includes Folder

I'll explain later, if I can be bothered. (For now, just look at the meta, layouts, and include views to work out what I've done.)

Routes

I have added an 'app' routes file and also configured this in App\ServiceProviders\RouteServiceProvider.php similar to the 'api' routes with a route prefix of 'app' - this is very common at the moment, and makes more sense to me. The app routes use the standard 'web' middleware. (I shouldn't need to explain why.)

  • The '/' route in the 'app' routes file now returns the app.dashboard view via the DashboardController (which has the 'auth' middleware). This replaces the old /home route in terms of purpose (especially considering that the panel heading is 'Dashboard').

Auth

  • I have removed the requirement for auth from the HomeController. As mentioned, there is now a Dashboard controller for directing to '/app/' which requires authentication.
  • Auth routes are still listed in the web routes file (because I don't think they should have the 'app' prefix) and work as usual. The redirects after auth actions now go to the app/ route as you would expect.
  • There is a small change for the Auth views in that they now extend the app.layouts.app view (just layouts.app before), but these views are unchanged in their appearance.
0 likes
0 replies

Please or to participate in this conversation.