Articles

Showing 10 posts
December 31st, 2023

Easily Copy Text to the Clipboard with Alpine.js

If you need to copy text to the clipboard with JavaScript, Alpine.js makes this super easy with the help of a simple plugin.

Author
Alex Garrett-Smith
Alpine.js
JavaScript
December 30th, 2023

Cleaner Loops With Laravel's Forelse Directive

If you're wrapping foreach loops around if statements in Blade, here's a much cleaner way to achieve the same thing with a single directive.

Author
Alex Garrett-Smith
Laravel
January 23rd, 2023

Using Enums as model casts in Laravel

Using accessors to return Enums from Laravel model attributes? There's an easier way.

Author
Alex Garrett-Smith
Laravel
January 11th, 2023

Change Carbon's now() value for testing

If you're working with Carbon dates, chances are your tests are going to fail at some point unless you're sure of the value returned from Carbon's now() function.

Author
Alex Garrett-Smith
Laravel
PHP
January 7th, 2023

How to Debounce Input in Vue 3

If you have (or want to implement) forms that autosave as a user types, there's a really important consideration to make when making requests to an API — the amount of requests you send.

Author
Alex Garrett-Smith
Vue
January 4th, 2023

How to check a Laravel project's version

Sure, it's pretty simple. But you're going to need check at some point.

Author
Alex Garrett-Smith
Laravel
April 15th, 2022

Setting up Laravel Friendship Relations

Friendships between users in an app is a pretty easy concept to grasp (you add me and we're friends), but to implement it properly isn't as straightforward.

Author
Alex Garrett-Smith
Laravel
January 29th, 2022

Clear orderBy in Laravel's Eloquent Builder

If you've tried to use `orderBy` on a previously ordered query in Laravel, you'll probably find it doesn't work. There's a great reason for that, which we'll explain at the end of the post.

Author
Alex Garrett-Smith
Laravel
Eloquent
January 28th, 2022

Enable HTTPS in Laravel Valet

By default, Laravel Valet doesn't use HTTPS. That's great, but if anything you're developing with locally requires HTTPS to be enabled, you're going to need it.

Author
Alex Garrett-Smith
Laravel
January 28th, 2022

Laravel Mix HMR with HTTPS

I use Laravel Valet for day-to-day development, and I recently got stuck getting Laravel Mix HMR (Hot Module Replacement) to work while I had HTTPS enabled through the `valet secure` command.

Author
Alex Garrett-Smith
Laravel

Tags