Get some insight on your Algolia indexing with this easy to use Nova card.
You can install the package in to a Laravel app that uses Nova via composer:
composer require nicolasbeauvais/nova-algolia-card
Next up, you must register the card Nova. This is typically done in the tools
method of the NovaServiceProvider
.
// in app/Providers/NovaServiceProvider.php
// ...
public function cards()
{
return [
// ...
new \NicolasBeauvais\NovaAlgoliaCard\NovaAlgoliaCard,
];
}
If you are already using Laravel Scout everything is already configured.
If not, you must create a config/scout.php
file with the following content:
<?php
return [
'algolia' => [
'id' => env('ALGOLIA_APP_ID', ''),
'secret' => env('ALGOLIA_SECRET', ''),
],
];
By default the card will show the total number of records across all your Algolia indexes. You can specify an index name to the card to show it's number of records:
// in app/Nova/User.php
// ...
public function cards()
{
return [
new \NicolasBeauvais\NovaAlgoliaCard\NovaAlgoliaCard((new \App\User)->searchableAs()),
// or
new \NicolasBeauvais\NovaAlgoliaCard\NovaAlgoliaCard('my_user_index'),
];
}
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email nicolasbeauvais1@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.