3 Simple Alpine.js Tips and Tricks
Here are 3 simple Alpine.js tips and tricks that you can start applying and using in your Alpine.js components right now!
Published 14 hours agoI'm a web developer, wannabe writer and space geek based in Essex, United Kingdom.
I currently work at Surewise where I build and maintain insurance systems.
A collection of tutorials, thoughts and brain dumps.
Here are 3 simple Alpine.js tips and tricks that you can start applying and using in your Alpine.js components right now!
Published 14 hours agoHere are 5 simple Laravel tips and tricks that you can start applying and using in your Laravel applications right now!
Published 1 day ago | Updated 1 day agoOut of the box, Highlight.php doesn't support Laravel Blade templates. I'll show you how to register a custom syntax so that you can start highlighting your Blade content.
Published 1 week ago | Updated 1 week agoTesting emails can be a pain. Luckily, there are plenty of tools out there that can make the process a lot easier. Let me show you how to setup MailHog, a local development tool for testing emails.
Published 1 week ago | Updated 1 week agoLet's take a look at how you can extend the CommonMark converter to make working with links easier and allow you to strikethrough text.
Published 2 months agoMarkdown is a great way of making notes, writing articles and generally managing content. Let's take a look at how quickly you can begin using Markdown in your PHP applications.
Published 2 months ago | Updated 2 months agoLearn how to build a remaining character counter in Alpine.js using only a few lines of code.
Published 2 months ago | Updated 2 months agoSometimes your controllers can get rather large, especially if you have lots of conditions and data formatting. Have you ever considered moving some of that complexity out into a dedicated response class?
Published 2 months ago | Updated 2 months agoHave you ever used a service provider to set a default value for a third-party library? Have you ever done this based on the current request or URL? Have you ever considered doing this inside of middleware instead?
Published 3 months ago | Updated 3 months agoA quick look at how you can configure your GitHub Actions workflows to only run when a certain phrase is present in the commit message.
Published 3 months ago | Updated 3 months agoLaravel makes use of the internal `Pipeline` class and it's more common in userland too, but have you ever considered tidying up these pipeline processes with custom pipeline classes?
Published 4 months ago | Updated 4 months agoReusability is important when it comes to scaling projects and future-proofing the maintainability of a project. Let's take a look at how you can write more re-usable components in Alpine.
Published 4 months ago | Updated 4 months agoHelper methods can be, well, helpful. Did you know that you can actually write helper methods in your Livewire classes and use them really easily in your Blade views?
Published 4 months ago | Updated 4 months agoWe all come across tasks that are repetitive and probably struggle to find ways of making them more re-usable in our Alpine components. Since v2.5 we can register custom magic variables that can help us out with that.
Published 4 months ago | Updated 4 months agoOne of jQuery's most powerful and popular features is the `slide` helpers and lots of people would like to replicate these in Alpine, so let's take a look at how we can do just that.
Published 5 months ago | Updated 5 months agoWhen registering grouped routes using `Route::group()`, it's normal to register those nested routes using the `Route` facade, but have you ever used the `$router` variable?
Published 6 months ago | Updated 5 months agoCode reusability is a big thing to consider when working on larger applications, but have you ever considered using synchronous jobs?
Published 6 months agoJoin me as I go through some strange and unconventional things that you can do in your Laravel applications, starting with auto-validating Laravel models.
Published 6 months agoAdding a class to make the current page "active" in your application's navigation is a simple UI improvement. Let me show you how I typically do this in my apps.
Published 6 months ago | Updated 6 months agoSharing data with your frontend doesn't need to be difficult, let's look at a couple of way of doing it.
Published 6 months ago | Updated 6 months agoLivewire provides a clean API for automatically polling and refreshing a component, but what if you want to manually refresh a component?
Published 7 months ago | Updated 7 months agoHow often do you see something like `2 * 24 * 60 * 60` and wonder what that value actually represents and what those magical numbers mean? Don't worry, Carbon's constants are here to help you out.
Published 7 months ago | Updated 7 months agoI find myself needing to loop over an array of dates quite often for forms at work. It's surprisingly easy thanks to Carbon.
Published 7 months agoAbstracting common queries in your Laravel applications can be done in many ways. Let's take a look at the simplest way using the "Repository pattern".
Published 7 months ago | Updated 2 months agoLots of people get caught out by the fact that Alpine evaluates each directive in a particular order. Let's look at the order it uses,
Published 7 months ago | Updated 7 months ago`x-cloak` can be used to hide elements until Alpine has initialised all components and has control of them.
Published 8 months ago | Updated 8 months agoWriting maintainable code is an important part of any software project. Let's take a look at some ways you can make your Alpine components more maintainable.
Published 8 months ago | Sponsors onlyIt's quite common to keep tabs on when an authenticated user last used your web application. The information can be really useful when calculating software adoption, usage frequency and return rate.
Published 8 months ago | Updated 8 months agoI previously wrote about using functions as computed properties in Alpine, but what if there was a better way?
Published 8 months ago | Updated 8 months agoOne of Alpine's main selling points is that it provides most of the reactive goodies that Vue and React do at a much lower cost. What if you don't need reactivity for your site? Well, Alpine can definitely still fit into your stack!
Published 9 months ago | Updated 8 months agoOne feature that I love in Vue is computed properties. You access them in the same way as normal data properties, but you can dynamically generate the value. Let's take a look at how we can do this in Alpine.
Published 9 months ago | Updated 8 months agoPHP has a function to pull the unique values out of an array, but why doesn't JavaScript?
Published 9 months ago | Updated 8 months agoRecently I've needed to disable particular methods and mutations on my Laravel models.
Published 9 months ago | Updated 8 months agoA brief look at the new Vue-inspired JavaScript framework, with no virtual DOM.
Published 9 months ago | Updated 8 months ago