Quality tutorials & resources. No BS._

Page 5

Sorting Meilisearch Results with Laravel Scout and Eloquent
Author Dan Pastori avatar
Dan Pastori April 4th, 2022

Meilisearch is an amazingly powerful full text search engine. In order to take full advantage of the power of Meilisearch and Laravel Scout, you’ll have to get in the nitty gritty. One of those times is when you want to sort search results with once they’ve been returned from Meilisearch.

When making a query through Laravel Eloquent, this is easy. Simply just add an ->orderBy('column_name', 'direction') to the end of your query. However, with Laravel Scout and Meilisearch, there needs to be a few steps in configuration before you can order your results. Since Meilisearch is such a fine tuned system, everything has to be configured explicitly. Luckily, Laravel provides that power out of the box. We just have to configure everything correctly.

Keep Reading →
Break between articles
Accessing Route Parameters in Nuxt 3 Part 5 of 9 in Upgrading Nuxt 2 to Nuxt 3
Author Dan Pastori avatar
Dan Pastori March 30th, 2022

Accessing route parameters is an essential for your Nuxt 3 app. Route parameters are the dynamic pieces of your URL that determine what resource or content is loaded. If you are following along in this migration guide, you probably have seen them accessed in action. In the last section, we loaded async data from the […]

Keep Reading →
Break between articles
Using asyncData in Nuxt 3 Part 4 of 9 in Upgrading Nuxt 2 to Nuxt 3
Author Dan Pastori avatar
Dan Pastori March 30th, 2022

Nuxt 3 has a slightly different syntax for using asyncData() than Nuxt 2. In this short tutorial, we will touch on a few of the differences we ran across when migrating ROAST from Nuxt 2 to Nuxt 3. There are a lot of updated changes when it comes to data fetching, so I’d recommend checking […]

Keep Reading →
Break between articles
Search Eloquent Relationships with Laravel Scout and Meilisearch
Author Dan Pastori avatar
Dan Pastori March 28th, 2022

When I first started to use Meilisearch with Laravel Scout, I wanted to query an Eloquent relationship along with my search. Like everything with Laravel, there was already a solution available. In this tutorial we will expand on the Laravel documentation and provide a few examples of how to include an Eloquent relationship’s model with a Meilsearch indexed record.

Prerequisite

I’m going to assume you already have a properly functioning Meilisearch instance up and running. Along with that, I’m going to assume you are using Laravel Scout with Laravel 9. However, this will work with older versions of Laravel if needed.

This is a really quick article, but is something I implement on most of my Meilisearch instances. The ability to search an index and get important related fields will make the UX of your app so much nicer!

Why would you do this?

Say you have an index of customers. Each of those customers has multiple email addresses. The email addresses are located in a related table in your database, say customer_email_addresses. When you search for customers with Laravel Scout in your app, allowing the user to search by an email address is crucial. If the email addresses are in a different table, no results would be returned. Luckily, there’s a simple solution to include these relationships in your Meilisearch index.

Keep Reading →
Break between articles
Using Environment Variables in Nuxt 3 Part 3 of 9 in Upgrading Nuxt 2 to Nuxt 3
Author Dan Pastori avatar
Dan Pastori March 22nd, 2022

There’s only a slight difference in how to reference environment variables from Nuxt 2 to Nuxt 3. Nuxt 3 provides a simple composable that you can include in your setup() method. Nuxt 2 set the environment variables in a global $config variable. The functionality is similar, but the syntax is slightly different, let’s take a […]

Keep Reading →
Break between articles
1 3 4 5 6 7 31