nathanheffley/nova-algolia

This package is abandoned and no longer maintained. No replacement package was suggested.

Algolia integration with Laravel Nova.

v1.0.0 2018-09-03 16:22 UTC

This package is auto-updated.

Last update: 2020-10-11 22:00:03 UTC


README

Latest Stable Version Total Downloads

image

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.