Credentials?

Issue #1 resolved
Stefan created an issue

Hello,

i just do not get where to put / generate the credentials for posting to an index?

Stefan

Comments (3)

  1. Alexey Sozonov repo owner

    You should create /config/algolia.php file and add something like that:

    <?php
    
    /*
     * This file is part of Laravel Algolia.
     *
     * (c) Vincent Klaiber <hello@vinkla.com>
     *
     * For the full copyright and license information, please view the LICENSE
     * file that was distributed with this source code.
     */
    
    return [
    
        /*
        |--------------------------------------------------------------------------
        | Default Connection Name
        |--------------------------------------------------------------------------
        |
        | Here you may specify which of the connections below you wish to use as
        | your default connection for all work. Of course, you may use many
        | connections at once using the manager class.
        |
        */
    
        'default' => 'main',
    
        /*
        |--------------------------------------------------------------------------
        | Algolia Connections
        |--------------------------------------------------------------------------
        |
        | Here are each of the connections setup for your application. Example
        | configuration has been included, but you may add as many connections as
        | you would like.
        |
        */
    
        'connections' => [
    
            'main' => [
                'id' => 'DKKSYIC0LV',
                'key' => '9b402a97dcb22a894b52bd01d84cc975',
            ],
    
            'alternative' => [
                'id' => 'your-application-id',
                'key' => 'your-api-key',
            ],
    
        ],
    
    ];
    

    Then you should modify your model and use console or something else (for example in backend widget you can use the next method - YourModel::reindex();).

    You can find more info here - https://github.com/algolia/algoliasearch-laravel#publish-vendor

  2. Stefan reporter

    Thanks! I tried the vendor publish command before, but somehow that file did not work. Yours did, thanks!

  3. Log in to comment