Articles

Showing 10 posts
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
November 21st, 2021

Recursive Nested Data in Laravel, The Right Way

Nested data is a pain point for a lot of developers. Relationships, eager loading and recursively iterating and displaying hierarchical data is enough to cause a headache.

Author
Alex Garrett-Smith
Laravel
November 13th, 2021

Recursively convert an array and its children to a Collection in Laravel

If you're dealing with plain array data, it often makes sense to convert it to a Laravel Collection so you can make use of the myriad helpers on the Collection class

Author
Alex Garrett-Smith
Laravel
July 14th, 2021

6 ways to avoid IF statements in Laravel

If statements are evil and should be avoided at all costs. Just kidding – but reducing the number of them can increase the readability/size of your code.

Author
Alex Garrett-Smith
Laravel
July 11th, 2021

Replicating Database Records in Laravel

I recently found myself needing to replicate a database record in Laravel. Turns out, there's a really easy way to achieve this.

Author
Alex Garrett-Smith
Laravel
July 6th, 2021

Renderless Vue Components in 5 Minutes

Renderless components in Vue are components that tuck away functionality without dictating how the UI for that functionality should look.

Author
Alex Garrett-Smith
Vue
May 6th, 2021

Clean Reusable Livewire Modals That You Can Trigger From Anywhere

Everyone loves modals, and with Livewire they're surprisingly easy to implement with the help of Alpine.js. I've been through so many iterations of the perfect modal setup, and *this* is the solution I've arrived at for clean, reusable modals that you can trigger from absolutely anywhere.

Author
Alex Garrett-Smith
Livewire
Laravel

Tags