Programmable Search Engine lets you include a search engine on your website. Because it is based on Google's core search technology, you can be confident that your users are getting high-quality, relevant results.
Instead of building your custom search engine for your website. Programmable search engine is a great alternative for saving your development time.
In this post, we will demonstrate how to integrate Google's programmable search engine into a Laravel project.
Firstly you need to register your site with programmable search engine at https://programmablesearchengine.google.com/. You will be prompted to validate your ownership of the site and so on.
resources/views/components/search.blade.phpand copy the search box code over:
Since we have obtained the search box code and saved them in
resources/views/components/search.blade.php. Simply place the component anywhere you wish to show the search.
In our project, we choose to render them on the home page by calling
<x-search/> in our view:
That is all for integrating Google Programmable Search engine into our site.
Google provides a lot of flexibility when it comes to customizing the search box. You can choose a template, customize the theme and enable automatic thumbnails for search results: