Blog

Fix Authorization header is missing when using Laravel Site Search

If you use the great package Laravel Site Search from spatie, you may get this error when you try to index the pages:

The Authorization header is missing. It must use the bearer authorization method.  

This error occurs, if you did not provide the Meilisearch key to the site_search_configs database entry. You have to add this to the extra column of your entry:

{"meilisearch":{"apiKey":"your-private-or-public-api-key"}}

For more information, see: https://spatie.be/docs/laravel-site-search/v1/basic-usage/authenticating-requests