GithubHelp home page GithubHelp logo

Comments (5)

mheap avatar mheap commented on June 3, 2024

Thanks @leonardeveloper.

Do you have a nexmo entry in config/services.php?

Your config/nexmo.php file should look like the following (generated by running php artisan vendor:publish:

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | API Credentials
    |--------------------------------------------------------------------------
    |
    | If you're using API credentials, change these settings. Get your
    | credentials from https://dashboard.nexmo.com | 'Settings'.
    |
    */

    'api_key'    => function_exists('env') ? env('NEXMO_KEY', '') : '',
    'api_secret' => function_exists('env') ? env('NEXMO_SECRET', '') : '',

    /*
    |--------------------------------------------------------------------------
    | Signature Secret
    |--------------------------------------------------------------------------
    |
    | If you're using a signature secret, use this section. This can be used
    | without an `api_secret` for some APIs, as well as with an `api_secret`
    | for all APIs.
    |
    */

    'signature_secret' => function_exists('env') ? env('NEXMO_SIGNATURE_SECRET', '') : '',

    /*
    |--------------------------------------------------------------------------
    | Private Key
    |--------------------------------------------------------------------------
    |
    | Private keys are used to generate JWTs for authentication. Generation is
    | handled by the library. JWTs are required for newer APIs, such as voice
    | and media
    |
    */

    'private_key' => function_exists('env') ? env('NEXMO_PRIVATE_KEY', '') : '',
    'application_id' => function_exists('env') ? env('NEXMO_APPLICATION_ID', '') : '',

];

from nexmo-laravel.

leonardeveloper avatar leonardeveloper commented on June 3, 2024

Here is my config/services.php

`<?php

return [

/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Stripe, Mailgun, SparkPost and others. This file provides a sane
| default location for this type of information, allowing packages
| to have a conventional place to find your various credentials.
|
*/

'mailgun' => [
    'domain' => env('MAILGUN_DOMAIN'),
    'secret' => env('MAILGUN_SECRET'),
],

'ses' => [
    'key' => env('SES_KEY'),
    'secret' => env('SES_SECRET'),
    'region' => 'us-east-1',
],

'sparkpost' => [
    'secret' => env('SPARKPOST_SECRET'),
],

'stripe' => [
    'model' => App\User::class,
    'key' => env('STRIPE_KEY'),
    'secret' => env('STRIPE_SECRET'),
],

];
And yes myconfig/nexmo.php` is the same with your code.

from nexmo-laravel.

mheap avatar mheap commented on June 3, 2024

I've just created a new Laravel 5.5 project and things seem to be working fine.

Bootstrap the project:

composer create-project --prefer-dist laravel/laravel blog "5.5.*"
cd blog
composer require nexmo/laravel

Update routes/web.php to send an SMS to test:

Route::get('/', function () {
    Nexmo::message()->send(['from' => "TEST", 'to' => "<number>", 'text' => "Hello World"]);
    return view('welcome');
});
php artisan serve

Visit http://127.0.0.1:8000/ - we should get the error you described

Edit .env and add your credentials:

NEXMO_KEY=
NEXMO_SECRET=

Visit http://127.0.0.1:8000/ again - the message should be sent fine

from nexmo-laravel.

leonardeveloper avatar leonardeveloper commented on June 3, 2024

I've just created a new Laravel project using the guide from above and got this new error message.

cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

Weird.
Unsure what I've missed.

from nexmo-laravel.

leonardeveloper avatar leonardeveloper commented on June 3, 2024

Fixed my last error message.
Perhaps it's some sort of installation issue on my end that the API credentials didn't worked.

All good now. Thanks a lot.

from nexmo-laravel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.