{"id":681,"date":"2022-11-15T17:58:44","date_gmt":"2022-11-15T17:58:44","guid":{"rendered":"https:\/\/www.devopstrainer.in\/blog\/?p=681"},"modified":"2022-11-15T17:58:44","modified_gmt":"2022-11-15T17:58:44","slug":"what-is-evn-file-why-we-use-evn-file-in-laravel","status":"publish","type":"post","link":"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/","title":{"rendered":"What is .evn file &#038; Why we use .evn file in laravel?"},"content":{"rendered":"\n<p>Laravel&#8217;s default .env file\u00a0contains some common configuration values that may differ based on whether your application is running locally or on a production web server. These values are then retrieved from various Laravel configuration files within the config directory using Laravel&#8217;s env function.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/Laravel-.env_.example.png\" alt=\"\" class=\"wp-image-682\" width=\"812\" height=\"457\" srcset=\"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/Laravel-.env_.example.png 560w, https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/Laravel-.env_.example-300x169.png 300w\" sizes=\"auto, (max-width: 812px) 100vw, 812px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">By default, the\u00a0.env\u00a0file includes following parameters<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>APP_ENV = local\r\nAPP_DEBUG = true\r\nAPP_KEY = base64:ZPt2wmKE\/X4eEhrzJU6XX4R93rCwYG8E2f8QUA7kGK8 =\r\nAPP_URL = http:\/\/localhost\r\nDB_CONNECTION = mysql\r\nDB_HOST = 127.0.0.1\r\nDB_PORT = 3306\r\nDB_DATABASE = homestead\r\nDB_USERNAME = homestead\r\nDB_PASSWORD = secret\r\nCACHE_DRIVER = file\r\nSESSION_DRIVER = file\r\nQUEUE_DRIVER = sync\r\nREDIS_HOST = 127.0.0.1\r\nREDIS_PASSWORD = null\r\nREDIS_PORT = 6379\r\nMAIL_DRIVER = smtp\r\nMAIL_HOST = mailtrap.ioMAIL_PORT = 2525\r\nMAIL_USERNAME = null\r\nMAIL_PASSWORD = null\r\nMAIL_ENCRYPTION = null<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">note:<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>The&nbsp;<strong>.env<\/strong>&nbsp;file should not be committed to the application source control, since each developer or user has some predefined environment configuration for the web application.<\/li><li>For backup options, the development team should include the&nbsp;<strong>.env.example<\/strong>&nbsp;file, which should contain the default configuration.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Where is the .env file located<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"460\" src=\"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/htaccess-step-1-1024x460.png\" alt=\"\" class=\"wp-image-683\" srcset=\"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/htaccess-step-1-1024x460.png 1024w, https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/htaccess-step-1-300x135.png 300w, https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/htaccess-step-1-768x345.png 768w, https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/htaccess-step-1.png 1322w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Starting from v1.28 , the .env file is placed&nbsp;<strong>at the base of the project directory<\/strong>. Project directory can be explicitly defined with the &#8211;file option or COMPOSE_FILE environment variable. Otherwise, it is the current working directory where the docker compose command is executed ( v1.28 )<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Laravel&#8217;s default .env file\u00a0contains some common configuration values that may differ based on whether your application is running locally or on a production web server. These values are then retrieved&hellip;<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-681","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What is .evn file &amp; Why we use .evn file in laravel? - DevOps | SRE | DevSecOps<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is .evn file &amp; Why we use .evn file in laravel? - DevOps | SRE | DevSecOps\" \/>\n<meta property=\"og:description\" content=\"Laravel&#8217;s default .env file\u00a0contains some common configuration values that may differ based on whether your application is running locally or on a production web server. These values are then retrieved&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/\" \/>\n<meta property=\"og:site_name\" content=\"DevOps | SRE | DevSecOps\" \/>\n<meta property=\"article:published_time\" content=\"2022-11-15T17:58:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/Laravel-.env_.example.png\" \/>\n<meta name=\"author\" content=\"shivam\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"shivam\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/\"},\"author\":{\"name\":\"shivam\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/0c8259479972d3d18994f88df3dc8d53\"},\"headline\":\"What is .evn file &#038; Why we use .evn file in laravel?\",\"datePublished\":\"2022-11-15T17:58:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/\"},\"wordCount\":166,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/Laravel-.env_.example.png\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/\",\"url\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/\",\"name\":\"What is .evn file & Why we use .evn file in laravel? - DevOps | SRE | DevSecOps\",\"isPartOf\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/Laravel-.env_.example.png\",\"datePublished\":\"2022-11-15T17:58:44+00:00\",\"author\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/0c8259479972d3d18994f88df3dc8d53\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/#primaryimage\",\"url\":\"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/Laravel-.env_.example.png\",\"contentUrl\":\"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/Laravel-.env_.example.png\",\"width\":560,\"height\":315},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.devopstrainer.in\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What is .evn file &#038; Why we use .evn file in laravel?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/#website\",\"url\":\"https:\/\/www.devopstrainer.in\/blog\/\",\"name\":\"DevOps | SRE | DevSecOps\",\"description\":\"Automation means Cost, Quality, Time\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.devopstrainer.in\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/0c8259479972d3d18994f88df3dc8d53\",\"name\":\"shivam\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/be603b13110d1423e9358d9f4b8901acd56c4239bca1b26b0225d217c2a2f1eb?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/be603b13110d1423e9358d9f4b8901acd56c4239bca1b26b0225d217c2a2f1eb?s=96&d=mm&r=g\",\"caption\":\"shivam\"},\"url\":\"https:\/\/www.devopstrainer.in\/blog\/author\/shivam\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is .evn file & Why we use .evn file in laravel? - DevOps | SRE | DevSecOps","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/","og_locale":"en_US","og_type":"article","og_title":"What is .evn file & Why we use .evn file in laravel? - DevOps | SRE | DevSecOps","og_description":"Laravel&#8217;s default .env file\u00a0contains some common configuration values that may differ based on whether your application is running locally or on a production web server. These values are then retrieved&hellip;","og_url":"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/","og_site_name":"DevOps | SRE | DevSecOps","article_published_time":"2022-11-15T17:58:44+00:00","og_image":[{"url":"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/Laravel-.env_.example.png","type":"","width":"","height":""}],"author":"shivam","twitter_card":"summary_large_image","twitter_misc":{"Written by":"shivam","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/#article","isPartOf":{"@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/"},"author":{"name":"shivam","@id":"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/0c8259479972d3d18994f88df3dc8d53"},"headline":"What is .evn file &#038; Why we use .evn file in laravel?","datePublished":"2022-11-15T17:58:44+00:00","mainEntityOfPage":{"@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/"},"wordCount":166,"commentCount":0,"image":{"@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/#primaryimage"},"thumbnailUrl":"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/Laravel-.env_.example.png","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/","url":"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/","name":"What is .evn file & Why we use .evn file in laravel? - DevOps | SRE | DevSecOps","isPartOf":{"@id":"https:\/\/www.devopstrainer.in\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/#primaryimage"},"image":{"@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/#primaryimage"},"thumbnailUrl":"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/Laravel-.env_.example.png","datePublished":"2022-11-15T17:58:44+00:00","author":{"@id":"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/0c8259479972d3d18994f88df3dc8d53"},"breadcrumb":{"@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/#primaryimage","url":"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/Laravel-.env_.example.png","contentUrl":"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/11\/Laravel-.env_.example.png","width":560,"height":315},{"@type":"BreadcrumbList","@id":"https:\/\/www.devopstrainer.in\/blog\/what-is-evn-file-why-we-use-evn-file-in-laravel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.devopstrainer.in\/blog\/"},{"@type":"ListItem","position":2,"name":"What is .evn file &#038; Why we use .evn file in laravel?"}]},{"@type":"WebSite","@id":"https:\/\/www.devopstrainer.in\/blog\/#website","url":"https:\/\/www.devopstrainer.in\/blog\/","name":"DevOps | SRE | DevSecOps","description":"Automation means Cost, Quality, Time","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.devopstrainer.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/0c8259479972d3d18994f88df3dc8d53","name":"shivam","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/be603b13110d1423e9358d9f4b8901acd56c4239bca1b26b0225d217c2a2f1eb?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/be603b13110d1423e9358d9f4b8901acd56c4239bca1b26b0225d217c2a2f1eb?s=96&d=mm&r=g","caption":"shivam"},"url":"https:\/\/www.devopstrainer.in\/blog\/author\/shivam\/"}]}},"_links":{"self":[{"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/posts\/681","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/comments?post=681"}],"version-history":[{"count":1,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/posts\/681\/revisions"}],"predecessor-version":[{"id":684,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/posts\/681\/revisions\/684"}],"wp:attachment":[{"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/media?parent=681"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/categories?post=681"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/tags?post=681"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}