Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nicolasbeauvais/nova-algolia-card
A Laravel Nova card for Algolia
https://github.com/nicolasbeauvais/nova-algolia-card
algolia card laravel nova
Last synced: about 1 month ago
JSON representation
A Laravel Nova card for Algolia
- Host: GitHub
- URL: https://github.com/nicolasbeauvais/nova-algolia-card
- Owner: nicolasbeauvais
- License: mit
- Archived: true
- Created: 2018-08-23T10:13:26.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-03-30T15:01:15.000Z (over 3 years ago)
- Last Synced: 2024-07-30T22:12:35.463Z (5 months ago)
- Topics: algolia, card, laravel, nova
- Language: PHP
- Homepage:
- Size: 1.03 MB
- Stars: 22
- Watchers: 3
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-laravel-nova - Nova Algolia Card
README
# Nova Algolia Cards
[![Latest Version on Packagist](https://img.shields.io/packagist/v/nicolasbeauvais/nova-algolia-card.svg?style=flat-square)](https://packagist.org/packages/nicolasbeauvais/nova-algolia-card)
[![Total Downloads](https://img.shields.io/packagist/dt/nicolasbeauvais/nova-algolia-card.svg?style=flat-square)](https://packagist.org/packages/nicolasbeauvais/nova-algolia-card)Get some insight on your Algolia indexing with this easy to use Nova card.
![nova-algolia-card](https://user-images.githubusercontent.com/2951704/44540973-dfbbbd80-a708-11e8-8387-057aa40fcbf0.png)
## Installation
You can install the package in to a Laravel app that uses [Nova](https://nova.laravel.com) via composer:
```bash
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`.
```php
// in app/Providers/NovaServiceProvider.php// ...
public function cards()
{
return [
// ...
new \NicolasBeauvais\NovaAlgoliaCard\NovaAlgoliaCard,
];
}
```## Config
If you are already using [Laravel Scout](https://laravel.com/docs/5.6/scout)
everything is already configured.If not, you must create a `config/scout.php` file with the following content:
```php
[
'id' => env('ALGOLIA_APP_ID', ''),
'secret' => env('ALGOLIA_SECRET', ''),
],
];
```
## UsageBy 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:```php
// 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](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
### Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
## Credits
- [Nicolas Beauvais](https://github.com/nicolasbeauvais)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.