nathanheffley / nova-algolia
Algolia integration with Laravel Nova.
Installs: 2 139
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=7.1.0
- algolia/algoliasearch-client-php: ^1.27
- laravel/scout: ^5.0
README
Installation
You can install the package in any Laravel app that uses Nova via composer:
composer require nathanheffley/nova-algolia
To 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.