Laravel as a Next.js alternative, how to seed a database, and more
Andrew's newsletter #27: Here's a few interesting things from the last couple weeks you might like.
Making the case for Laravel as a Next.js alternative
I published this article a few days ago because I wanted to showcase how effective Laravel could be at being a Next.js alternative. I didn’t want this to come from a place of competition, but more of a showcase for the full-stack power that the PHP framework has out-of-the-box.
Especially this year with first-party additions like Folio, Volt, and LiveWire, and community support from packages like LiveWire and Spatie’s Export plugin. What do you think? Does Laravel stand up against Next.js?
A few different ways to seed databases in Laravel
Seeding a database is a pretty standard thing when working in Laravel, but it can be a bit tricky to get started. There’s more than one “right” way to get data into your application, so I decided to show off a few different methods in a short video.
There’s some pros and cons to each, but whatever way you end up choosing it’s a lot better than manually populating your database with test or seed data!
Filament V3 Released
[Filament] version 3 was released recently, and with it came a slew of new features and quality of life improvements. Unfamiliar with Filament?
Built on top of the TALL stack (Tailwind, Alpine.js, Laravel, + LiveWire), Filament is a collection of packages and components to help you build a great-looking application with minimal effort. Using a suite of commands, classes, and your application’s own codebase, you can scaffold out an admin panel in just minutes.
You also don’t have to commit to the TALL stack for your entire application either, and can use Filament in isolation (which makes it pretty great for existing projects, too). Check out the whole project on [GitHub].
Using HTMX in Laravel
If you haven’t had the opportunity to take a look at [HTMX] yet, you may be missing out on one of the coolest libraries I’ve played around with this year. It’s a no-frills package that promises access to things like AJAX and WebSockets directly in your HTML attributes, no extra JS required.
Andre Madarang recently released a solid video that shows off how to install and use HTMX inside of a Laravel application.
It’s a perfect fit, really. Because of the nature of HTMX, the server responding should be piping through raw HTML instead of something like JSON. In Laravel, by just using `return view()` you can send a response with HTML back to the requesting client with just that single line.
Today I learned
This issue’s today I learned comes from Chris Sev on Twitter. If you use VS Code as your main editor, there’s a setting to create a “sticky header” that will always show info about your position. Check it out:
https://twitter.com/chris__sev/status/1692565265169695224
That’s it for now! If you want to submit any news, articles, packages, or tutorials, send me an [email] or message on [Twitter].