Latest Posts

Building a blog with Laravel

Tech Stacks

Detailing my decisions and choices when making this blog I give a quick insight into the technology stack that I chose and some of the reasons why.


For a couple of years now I've been considering starting a blog in the hope that it will be useful for my own memory and quite possibly others.

Let's face it, developers encounter a lot of challenges during a day of work as that is literally the job role. However, remembering all of the solutions without trawling through previous projects, and trying to remember what project I did X on can be tricky. By documentation the more difficult challenges, or perhaps even quick wins every now and then, I hope that I can provide a quick searchable reference for myself, and even some tips and tricks for others.

Going Bespoke

There are plenty of 'off the shelf' blogging platforms out there, but I'd much rather the challenge, and the ability to manipulate and enhance my blog as it ages. Sure, there are many components on this site that I haven't built entirely from scratch, but I'll go through that in a little more detail below. So I chose Laravel, the framework I know and love to forge this little side project.

After all, this is what I do for a day job, so I should be pretty good at it, right?

Why Laravel?

Laravel is an excellent framework, whether it's used to build a simple feedback form, blog site, or extremely complex application - Laravel provides a solid foundation and the raw materials for any project. I've been using Laravel since Laravel 5, released in 2015, and it never fails to amaze me and I'm learning new things every day.

Laravel

Laravel is PHP based and there's no doubting that as a language PHP has had it's challenges over the last 10 years not being the new kid on the block, but I think Laravel has done wonders to the PHP ecosystem and helped make the language more relevant than ever.

The TALL Stack

The TALL Stack is a collection of four frameworks to help aid rapid development. Tailwind (a great CSS styling framework), Alpine (a JS reactivity framework), Laravel (the PHP framework) and Livewire (the magic API-like glue between JS and Laravel) is what I chose to use. The reason is pretty simple - put together, this stack provides the perfect harmony in capability and productivity. It allows for rapid development with all the functionality I'd ever need.

Tailwind CSS

Tailwind is a CSS Framework utlity that differs from the traditional CSS norms, by providing lots of 'utility' classes that perform smaller tasks, e.g. text-xs to make a section of text 'extra small', or grid grid-cols-3 gap-1 to create a three column CSS grid with a relative gap between each item.

TailwindCSS

Tailwind gives the benefit of not needing to delve into your CSS files and because of this architecture, once compiled, the resulting file is generally very small. The stylesheet on this blog for example is (at the time of writing) sub 25kb once compiled, add some compression to that (Brotli) and we're talking < 5kb.

I've been using this for a number of years now on commercial projects and it gives the ability to rapidly wireframe and build up pages and structures with very little hassle.

As a sidenote, the team at Tailwind also offer Heroicons, and TailwindUI components, both of which I have utilised on this blog.

Alpine.js

Alpine is a relatively new kid on the block, a JavaScript reactivity framework heavily pushed and adopted with the Laravel ecosystem. It's used for the core (frontend) internals of Livewire and allows you to quickly implement JavaScript reactivity, e.g. responding to a user click or form input.

Alpine.js

It does this, all while being embedded directly in the HTML, meaning again, you don't even have to leave your views to code in some serious reactivity and transitions. I'll try and write a separate post on this as it's a pretty vast subject.

Alpine is quietly used on this website on the search bar, or toggling light/dark mode for example.

Laravel Livewire

Livewire bridges the gap between the frontend Alpine interactivity, and backend communication. It provides an API-like interface and is grouped as 'components'. Each component has a view, and a PHP class to process the data.

Laravel Livewire

This allows for the rapid development of some seriously complex stuff. Although, on the blog site we're only using Livewire for the contact form and to persist the light/dark mode state, we utilise it heavily through my admin panel which is built upon FilamentPHP. Filament is relatively new to me but boy has it changed the game! I just wish it'd been about sooner.

Laravel

I've discussed Laravel above so no need to go into much more detail than that, but I've used Laravel to do so much and build so much and I look forward to seeing it grow even more of the years.

That'll do for now, I look forward to working through challenges from servers, programming and personal and getting them noted on here!