0

Hi I am using a laravel package https://github.com/greggilbert/recaptcha and I have published the config files where I need to store my public and private keys for my recaptcha. I want to call this elsewhere in my app in an attempt to process this via AJAX . I've tried to call this as

dd(Config::get('packages.greggilbert.recaptcha')['public_key']);

however this returns as null. The array is kept in the following folder:

app/config/packages/greggilbert/recaptcha/config.php

the array is built as so:

<?php

return array(


    'public_key'    => 'publickey',
    'private_key'   => 'privatekey',

    'template'      => '',

    'driver'    => 'curl',

    'options'       => array(

        'curl_timeout' => 1,

    ),

    'version'       => 2,

); 

Any ideas how I can retrieve the public_key value??

1 Answer 1

1

Retrieving configs from a package works a bit different. You use a so-called namespace:

Config::get('recaptcha::public_key');
Sign up to request clarification or add additional context in comments.

1 Comment

oh i see, thanks! i will accept when the timer runs out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.