Category: Laravel, Laravel, api, api

In this article I want to show you the best practices of configuring your Laravel application. Laravel uses https://github.com/vlucas/phpdotenv to set up the configuration of your application.

Think of stuff like usernames, passwords and API tokens that you don't want to upload to your public repository. You don't add this file to your repository, the whole point is that you keep it private.

So, now that your configuration is set up it is time to use these values in your application code.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners