Articles

Showing 10 posts
February 13th, 2025

How to Manually Bundle Alpine Into a Livewire Project

If you want to add your own Alpine components and plugins to a Livewire Project, you'll have to manually add Livewire and Alpine to take control.

Author
Alex Garrett-Smith
Livewire
February 12th, 2025

Add These to Every New Laravel Project

Out of the box, Laravel is configured for you to be productive immediately without thinking about much. Let's take it a step further and add some opinionated configuration to improve developer experience.

Author
Alex Garrett-Smith
Laravel
February 6th, 2025

Textarea Mentions with Alpine.js and Tribute

Adding mention triggers to textareas is easy with Tribute. In this article, we'll set up the ability to type a trigger (like @) and display/search a list of users for insertion.

Author
Alex Garrett-Smith
Alpine.js
Laravel
JavaScript
February 5th, 2025

Laravel's incrementOrCreate Method

Added in Laravel 11, incrementOrCreate is a method to create a record uniquely based on a pre-defined array.

Author
Alex Garrett-Smith
Laravel
Eloquent
February 3rd, 2025

How to fix "Add [column] to fillable property to allow mass assignment on [Model]" in Laravel.

This mass assignment error is a really common one when working with Laravel. Here's how to fix the inability to insert/update records.

Author
Alex Garrett-Smith
Eloquent
Laravel
February 1st, 2025

Mocking IP Addresses in Laravel for Testing

When it comes to testing anything that stores IP addresses in Laravel, you may want to mock the return value of request()->ip() to verify that something has been stored correctly, etc.

Author
Alex Garrett-Smith
Testing
Laravel
January 31st, 2025

3 Ways to Get a User's IP Address in Laravel

Need a user's IP address in Laravel? Here are three ways to grab it, depending on your preference.

Author
Alex Garrett-Smith
Laravel
January 30th, 2025

How to Use updateOrCreate in Laravel

If you have a potentially existing record and need to update it if it exists or create it if it doesn't. Here's how!

Author
Alex Garrett-Smith
Eloquent
Laravel
January 30th, 2025

How to Cast Pivot Table Columns in Laravel

In this article, I'll show you how to set up casts for pivot table columns in your Laravel relationships.

Author
Alex Garrett-Smith
Eloquent
Laravel
January 27th, 2025

How to Publish Inertia's Config File in Laravel

Need to make a tweak to Inertia's default config? Here's how to publish the config/inertia.php config file.

Author
Alex Garrett-Smith
Inertia

Tags