Summer sale! Save 50% on access to our entire library of courses.Join here →

Articles

Showing 10 posts
April 18th, 2024

How to get the table name from a model in Laravel

Table names don't change often, but it's still nice to reference table names directly from your Eloquent models, so you don't end up with a bunch of hardcoded table names.

Author
Alex Garrett-Smith
Eloquent
Laravel
March 14th, 2024

How to Paginate a Laravel Collection

If you're merging multiple models into a Laravel collection or just have a collection of data you need to paginate, here's an easy, clean way to do it.

Author
Alex Garrett-Smith
Laravel
Eloquent
March 11th, 2024

Generate Open Graph Social Sharing Images With Laravel

Here's the technique I use to design, generate, cache and serve social images for the article you're reading right now.

Author
Alex Garrett-Smith
Laravel
March 8th, 2024

Counting Unique Views in Laravel with Redis

If you want to count unique views for models in your Laravel apps, you might reach for a database table. There's a much easier and faster way though, using Redis.

Author
Alex Garrett-Smith
Laravel
Redis
March 7th, 2024

Checking for Insert Collisions in Laravel

When you fill a database row with any kind of random or generated data, checking for collisions is a great idea.

Author
Alex Garrett-Smith
Laravel
Eloquent
March 7th, 2024

Drag and Drop Sorting With Livewire

If you have a list of items you need to be able to drag, drop, then set a new order in the database — good news, it's pretty straightforward to do with Livewire and Alpine.

Author
Alex Garrett-Smith
Alpine.js
Livewire
February 22nd, 2024

Adding a Progress Bar to Livewire File Uploads

Uploading files in Livewire is super simple — but for larger files, adding a progress bar is a great idea.

Author
Alex Garrett-Smith
Livewire
Alpine.js
February 22nd, 2024

Prevent Livewire Refreshes and State Loss When Hot Reloading with Vite

If you're here, you're likely suffering from unexpected state loss in your Livewire components when using Vite.

Author
Alex Garrett-Smith
Livewire
February 21st, 2024

Securing Your Laravel Herd Sites with TLS

Laravel Herd comes with full TLS (an upgraded version of SSL) support out the box, but it's not as easy as just switching it on if you're using a build tool like Vite.

Author
Alex Garrett-Smith
Server
Laravel
January 7th, 2024

Loading States With Livewire

There are a bunch of ways to show loading states in Livewire. Let's take a look at a few methods, as well as some customisation options to fine tune your UI.

Author
Alex Garrett-Smith
Livewire

Tags