Algolia integration with Laravel Nova.
Installation
You can install the package in any Laravel app that uses Nova via composer:
composer require nathanheffley/nova-algoliaTo view your indexed search data for a Searchable model, you'll need to add the tool to that model's Nova resource. Make sure to specify the class name so the resource tool can load it properly.
// in app/Nova/ResourceName.php
public function fields(Request $request)
{
return [
// ...
\NathanHeffley\NovaAlgolia\AlgoliaResourceTool::make()->className(\App\ModelName::class),
];
}If you want to use the "Import to Algolia" or "Remove from Algolia" actions, you just need to add them to the actions array on your Nova resource.
// in app/Nova/ResourceName.php
public function actions(Request $request)
{
return [
// ...
new \NathanHeffley\NovaAlgolia\Actions\ImportAlgolia,
new \NathanHeffley\NovaAlgolia\Actions\RemoveAlgolia,
];
}If you have not set up Scout or Algolia yet, follow the directions from the official instructions: Algolia and Laravel Scout.
License
The MIT License (MIT). Please see LICENSE for more information.
