nicolasbeauvais / nova-algolia-card
A Laravel Nova card for Algolia
Installs: 7 164
Dependents: 0
Suggesters: 0
Security: 0
Stars: 23
Watchers: 1
Forks: 1
Open Issues: 3
Requires
- php: >=7.1.0
This package is auto-updated.
Last update: 2021-04-30 15:07:12 UTC
README
Get some insight on your Algolia indexing with this easy to use Nova card.
Installation
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, ]; }
Config
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', ''), ], ];
Usage
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'), ]; }
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email nicolasbeauvais1@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.