Quality tutorials & resources. No BS._

Page 5

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
Setting Page Titles in Nuxt 3 Part 2 of 9 in Upgrading Nuxt 2 to Nuxt 3
Author Dan Pastori avatar
Dan Pastori March 22nd, 2022

When migrating from Nuxt 2 to Nuxt 3, setting page titles is slightly different. In Nuxt 2 setting page meta data is done through the head() helper function. Or, if you define a title globally, you could set it in the nuxt.config.js. In Nuxt 3, page titles are set through the useMeta() composable function or […]

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