DEV Community

Cover image for Build SPA's fast in Laravel
Abraham
Abraham

Posted on

Build SPA's fast in Laravel

Sorry what?๐Ÿ˜’

Calm down. I'll explain myself.
What I'm trying to tell you is an opinionated way to build an SPA with a PHP Laravel backend; Supposedly very fast.

Laravel SPAs

Norms... This means a Laravel API Connected to a React, Vue, Svelte or whatever frontend. Maybe Sanctum to handle your API's. Pusher and Echo, and many other bla blas...๐Ÿค”
Alt Text

So what?๐Ÿคจ

Well let's roll that back. Shall we? โช
Let's Drop the API part, so we have Laravel and InertiaJs with React, Vue or any other of your choice.
Alt Text

Hmm๐Ÿ˜ณ

Now Tush up your SPA Authentication with everything Fortify has to offer by using Fortify UI.
Fortify gives you the prebuilt authentication pages in all their raw glory. No styling and confusion.
All you have to do is follow it's lead. Create your components, and post your forms to the same routes used in FOrtify UI's views.

Happy Coding!

Top comments (2)

Collapse
 
nathandaly profile image
Nathan Daly • Edited

Pretty much anyone who takes Laravel seriously already knows about Inertia. You could bulk up your article to match the title and demonstrate how you build SPA's fast in Laravel using Inertia. You could build them just as fast using laravel-mix and Vue 3 without Inertia and have Laravel just handle HTTP requests. What makes Inertia especially good for SPA's?

Collapse
 
anubra266 profile image
Abraham

Thanks a lot for your feedback.