Blog - My Latest Writings

New Website

Published

This website has been updated. Mcintosh.io is now a Laravel 11 application. I was running WordPress on Bedrock previously. I plan to continue to make upgrades and updates but I've learned to launch early (otherwise I'll try to perfect it till its launched and I'll never launch anything). Its not perf...

Read more

Why Are All My Alpine.js Animations Firing at The Same Time?

Published

Alpine.js represents an incredibly potent suite of utilities in a small and cohesive package. One of my favorite directives in Alpine has been the x-transition attribute. The x-transition attribute makes it really easy to add tasteful transitions to your markup. I encountered a challenge when I tried to animate a list...

Read more

How to Trigger a Livewire Method from Outside a Livewire Component

Published

Alpine.js and Livewire are two of the most popular JavaScript frameworks for Laravel. Alpine is a lightweight framework that allows you to add interactivity to your web pages without having to write a lot of code. Livewire is a framework that allows you to build interactive web pages with server-side logic. Alpi...

Read more

How to Test File Uploads in Laravel

Published

Laravel makes it really easy to test if a file was uploaded in phpunit. Lets take a look at what it it takes to test for files. Lets say that we have a method containing the following code that we want to test. GetFile.php The corresponding test that would provide coverage for that code is the following. GetFileT...

Read more

Time Saving Shell Aliases For Laravel Sail

Published

I find it tiring to type the same long commands out repeatedly. When working locally, I’m currently using Laravel Sail for my environment. Laravel Sail describes itself using the following. Laravel Sail  is a light-weight command-line interface for interacting with Laravel’s default Docker development environment....

Read more

How To Conditionally Display an Algolia Filter using Vue InstantSearch

Published

I needed to conditionally display a filter in Algolia. I was using vue.js to put the UI together for the site. Conditional display of the filter should be an easy thing but apparently Algolia recently removed easy access to the UI state object. You can find other reported instances of this issue here https://github.c...

Read more

Using The Events Calendar Plugin with Timber and Twig

Published

Ensure the Timber Plugin or Composer dependency is installed Install the Events Calendar Plugin This works for the free version. If using the paid version of the plugin – you might have to modify the other steps. Activate the Events Calendar Plugin Create the template file for the override Create a file at the fol...

Read more

Use Webpack Without Writing a Webpack Config

Published

I doubt you got into web development because of your desire to write Webpack configs. You shouldn’t have to waste hours to create your bundles. Webpack can sometimes feel like this unagreeable middleman if you haven’t spent significant time with the documentation and hands on experience. Even if you do have conside...

Read more

How To Merge Unrelated Git Histories With Conflicts

Published

I recently took over a project that was hosted on WP Engine. When I took over the project I didn’t have a git repository for it. I could have pulled from WP Engine initially – but I didn’t. I downloaded from a WP Engine backup instead and committed this to my new git repository. This was the start of my problem. The c...

Read more

© Chris Mcintosh 2024