W
W
WebDev2016-07-29 12:12:50
Laravel
WebDev, 2016-07-29 12:12:50

Where do you store Laravel data?

For example, tokens and keys for accessing social media APIs, which can be used in several places in the application. Where is the best place to store them?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stanislav Pochepko, 2016-07-29
@kirill-93

.env file

I
i_albakov, 2016-07-31
@i_albakov

I think it's best to have a separate file, let's say constants.php put it in the config folder . After that, you can access it from anywhere config('constants.twitter_api_key') .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question