{"id":32785,"date":"2023-02-13T05:37:32","date_gmt":"2023-02-13T05:37:32","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=32785"},"modified":"2023-02-13T05:37:35","modified_gmt":"2023-02-13T05:37:35","slug":"list-of-setting-in-env-for-production-environment-for-secured-laravel-projects","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/list-of-setting-in-env-for-production-environment-for-secured-laravel-projects\/","title":{"rendered":"List of setting in .env for production environment for secured laravel projects"},"content":{"rendered":"\n<p>In a production environment, it&#8217;s important to configure certain settings in the <code>.env<\/code> file to ensure that your Laravel application is secure and performant. Here are some key settings to consider:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><code>APP_ENV<\/code>: Set the environment to <code>production<\/code> to ensure that the application is optimized for production use.<\/li>\n\n\n\n<li><code>APP_DEBUG<\/code>: Set this to <code>false<\/code> to turn off debugging and prevent sensitive information from being leaked to the end user.<\/li>\n\n\n\n<li><code>APP_KEY<\/code>: Set a strong, random encryption key for the application.<\/li>\n\n\n\n<li><code>DB_*<\/code>: Set the database connection settings, including the database host, username, password, and database name.<\/li>\n\n\n\n<li><code>CACHE_DRIVER<\/code>: Set the cache driver to <code>redis<\/code> or <code>memcached<\/code> for better performance in production.<\/li>\n\n\n\n<li><code>SESSION_DRIVER<\/code>: Set the session driver to <code>redis<\/code> or <code>memcached<\/code> for better performance in production.<\/li>\n\n\n\n<li><code>MAIL_DRIVER<\/code>: Set the mail driver to <code>smtp<\/code> and configure the settings for your email provider.<\/li>\n\n\n\n<li><code>BROADCAST_DRIVER<\/code>: Set the broadcast driver to <code>pusher<\/code> or <code>redis<\/code> for better performance in production.<\/li>\n\n\n\n<li><code>QUEUE_DRIVER<\/code>: Set the queue driver to <code>redis<\/code> or <code>database<\/code> for better performance in production.<\/li>\n\n\n\n<li><code>REDIS_*<\/code>: If you are using Redis as a cache, session, or queue driver, set the Redis connection settings.<\/li>\n\n\n\n<li><code>MEMCACHED_*<\/code>: If you are using Memcached as a cache or session driver, set the Memcached connection settings.<\/li>\n\n\n\n<li><code>FILESYSTEM_DRIVER<\/code>: Set the filesystem driver to <code>s3<\/code> or <code>rackspace<\/code> if you are using a cloud-based storage service.<\/li>\n\n\n\n<li><code>AWS_*<\/code> or <code>RACKSPACE_*<\/code>: If you are using a cloud-based storage service, set the connection settings for that service.<\/li>\n<\/ol>\n\n\n\n<p>By setting these production environment variables in the <code>.env<\/code> file, you can ensure that your Laravel application is optimized and secure for use in a production environment.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"480\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/02\/image-19.png\" alt=\"\" class=\"wp-image-32786\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/02\/image-19.png 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/02\/image-19-300x141.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/02\/image-19-768x360.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"982\" height=\"541\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/02\/image-20.png\" alt=\"\" class=\"wp-image-32787\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/02\/image-20.png 982w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/02\/image-20-300x165.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/02\/image-20-768x423.png 768w\" sizes=\"auto, (max-width: 982px) 100vw, 982px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>In a production environment, it&#8217;s important to configure certain settings in the .env file to ensure that your Laravel application is secure and performant. Here are some key settings to&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[2],"tags":[],"class_list":["post-32785","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/32785","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=32785"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/32785\/revisions"}],"predecessor-version":[{"id":32788,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/32785\/revisions\/32788"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=32785"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=32785"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=32785"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}