Provision Melee Search Server 0:00Aside from just web and database servers, Forge is also able to provision servers with Melee Search. If you're unfamiliar, the Melee Search website describes it as an open-source, lightning-fast, and hyper-relevant search engine that fits effortlessly into your apps, websites, and workflow. And best of all, Melee Search is also 100% compatible with Laravel Scout, and so it can easily be added into our Laravel applications. To get started with Melee Search, we need to provision a new server. We'll go up to create server, and we'll select our provider, and we can just select a type. We'll use Melee Search, and I will make sure that I add this to our network, and we can click create server.and we can just select a type. We'll use Melee Search, and I will make sure that I add this to our network, and we can click create server. Now this time, when Forge shows us the server credentials modal, it will give us our sudo password, but it will also contain the Melee Search password. We'll need this when our server has finished provisioning to get access to our Melee Search API keys. Once our server has finished provisioning, Forge will take us to the server's dashboard, and we can see that we have one active site here, which is the default Melee Search server. If we go to our server's IP address, we can see that we have a JSON response saying status Melee Search is running. Now we can also see that Forge is showing us a Melee Search panel. This panel is specific to Melee Search servers, and we can provide it with the password that we Configure Env and API Keys 1:13status Melee Search is running. Now we can also see that Forge is showing us a Melee Search panel. This panel is specific to Melee Search servers, and we can provide it with the password that we were shown when we started to provision the server, but it will also be an email to us. We can then reveal the API keys. We need to use the admin API key. This is what is used on the backend and should not be used on the frontend. We will copy that, and we also need to make a note of the server's private IP address. We'll then head over to our site and go to the environment, and now we need to make a couple of changes. We're going to add the Scout driver, and we'll install Scout in a second, but we will say Melee Search, and then we need to add Melee Search host, which is HTTP 10.0.0.3, and then Melee Search runs on port 7.7.0.0. Then finally, we need to add the Melee Search key, and this is what tells Install and Configure Scout 2:05and then we need to add Melee Search host, which is HTTP 10.0.0.3, and then Melee Search runs on port 7.7.0.0. Then finally, we need to add the Melee Search key, and this is what tells Laravel Scout that it can authenticate and add our records. Let's click save. So the next thing that we need to do is install Laravel Scout. We can do that with the composer require Laravel Scout. Once that's installed, we can do artisan vendor publish, and we will need to install the Scout service provider. Once Laravel Scout is installed into our project, we can then make a few changes. The first thing to check is the Scout configuration file. Now we've already configured Scout driver, but by default, it will use Algolia. Algolia is an alternative to Elasticsearch, but it is a paid service. The next thing we need to do is add the Scout searchable trait to our model. Update Model and Routes 2:57Algolia is an alternative to Elasticsearch, but it is a paid service. The next thing we need to do is add the Scout searchable trait to our model. This is what tells our application to add our records, our database records to Melee Search whenever they are added or updated. Then finally, I've just added a search route here that will create a new person based on the first name, last name, and age. We'll use this to demonstrate how Melee Search works. Before we can deploy this, we also need to add the Melee Search library to our application. The Laravel documentation tells us how to install this and also for other providers too. With Scout installed and our application deployed to our server, we can now demonstrate how this works. We'll go over to our search route, and first name is James, last name is Brooks, and my age is 30. There we go. We shouldn't expect anything because Verify Indexing and Search 3:42we can now demonstrate how this works. We'll go over to our search route, and first name is James, last name is Brooks, and my age is 30. There we go. We shouldn't expect anything because we didn't have a response. We'll now do the same for my wife Katie, and it's added that in as well. We can verify that the index has been created and the records added to it by using an application such as Insomnia or Postman. Here I'm using Insomnia, and I have my server's IP address and indexes. I've configured a bearer token to use the API key, and if we request this, we can see we have a people index. We can then see all documents inside of this index by going to the index ID here, which is people, and the documents. We can see now that we've got James, age 30, and Katie. Our application can now use Scout to search our Melee search data.age 30, and Katie. Our application can now use Scout to search our Melee search data.