{"id":6531,"date":"2023-02-21T23:38:45","date_gmt":"2023-02-21T18:08:45","guid":{"rendered":"https:\/\/trysiteprice.com\/blog\/?p=6531"},"modified":"2023-02-21T23:51:53","modified_gmt":"2023-02-21T18:21:53","slug":"how-to-change-domain-of-laravel-project","status":"publish","type":"post","link":"https:\/\/trysiteprice.com\/blog\/how-to-change-domain-of-laravel-project\/","title":{"rendered":"how to change domain of laravel project ?"},"content":{"rendered":"<p>To change the domain of a Laravel project, you will need to perform the following steps:<\/p>\n<ul>\n<li>Update the domain name in the web server configuration: If you&#8217;re using Apache, edit the virtual host configuration file for the domain and update the &#8220;ServerName&#8221; and &#8220;ServerAlias&#8221; directives. If you&#8217;re using Nginx, update the &#8220;server_name&#8221; directive in the server block.<\/li>\n<li>Update the &#8220;APP_URL&#8221; configuration value: In your Laravel project&#8217;s &#8220;.env&#8221; file, update the &#8220;APP_URL&#8221; value to reflect the new domain name.<\/li>\n<li>Clear the application cache: Run the following command to clear the application cache: <code>php artisan cache:clear<\/code><\/li>\n<\/ul>\n<p>To clear the application cache using the <code>php artisan cache:clear<\/code> command in Laravel, you can follow these steps:<\/p>\n<ol>\n<li>Open a terminal or command prompt window.<\/li>\n<li>Navigate to your Laravel project&#8217;s root directory.<\/li>\n<li>Run the following command: <code>php artisan cache:clear<\/code><\/li>\n<\/ol>\n<p>This command will clear the application cache, including any cached views, configurations, routes, and other data that may have been cached by your application.<\/p>\n<p>After running this command, you may need to regenerate any cached data that your application relies on. For example, if you have used Laravel&#8217;s caching system to store frequently accessed data, you may need to regenerate that data after clearing the cache.<\/p>\n<p>Keep in mind that clearing the cache may affect the performance of your application temporarily, as your application will need to re-cache any data that it needs. However, clearing the cache can also be a useful troubleshooting step if you are experiencing issues with your application.<\/p>\n<p>&nbsp;<\/p>\n<p>you can clear the Laravel application cache from the file manager as well. To do so, follow these steps:<\/p>\n<ol>\n<li>Navigate to your Laravel project&#8217;s root directory using the file manager.<\/li>\n<li>Locate the &#8220;bootstrap\/cache&#8221; directory and delete all files within it.<\/li>\n<li>Optionally, you can also delete the contents of the &#8220;storage\/framework\/cache&#8221; directory to clear any cached data stored by the framework.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ul>\n<li>Clear the route cache: If you have enabled route caching, run the following command to clear the route cache: <code>php artisan route:cache<\/code><\/li>\n<li>Generate a new application key: Run the following command to generate a new application key: <code>php artisan key:generate<\/code><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>To generate a new application key for a Laravel project using the file manager, you will need to follow these steps:<\/p>\n<ol>\n<li>Navigate to your Laravel project&#8217;s root directory using the file manager.<\/li>\n<li>Locate the <code>.env<\/code> file and open it for editing.<\/li>\n<li>Look for the <code>APP_KEY<\/code> value in the file, and delete the existing value. Leave it blank for now.<\/li>\n<li>Save and close the <code>.env<\/code> file.<\/li>\n<li>Navigate to the <code>bootstrap<\/code> directory and locate the <code>cache<\/code> directory.<\/li>\n<li>Delete the <code>config.php<\/code> file within the <code>cache<\/code> directory. This will clear any cached configuration values, including the old <code>APP_KEY<\/code>.<\/li>\n<li>Go back to the root directory of your Laravel project, and open a terminal or command prompt window.<\/li>\n<li>Run the following command to generate a new application key: <code>php artisan key:generate<\/code><\/li>\n<li>After running the command, go back to the <code>.env<\/code> file and you should see that the <code>APP_KEY<\/code> value has been updated with a new key.<\/li>\n<li>Save and close the <code>.env<\/code> file.<\/li>\n<\/ol>\n<p>That&#8217;s it! You have now generated a new application key for your Laravel project using the file manager. Note that clearing the configuration cache (<code>config.php<\/code> file) is important because Laravel caches configuration values for better performance. Without clearing the cache, the old <code>APP_KEY<\/code> value would still be used even if you generate a new one.<\/p>\n<ul>\n<li>Restart the web server: Finally, restart the web server to apply the changes.<\/li>\n<\/ul>\n<p>Once you&#8217;ve completed these steps, your Laravel project should be accessible via the new domain name. Be sure to also update any links or references to the old domain name throughout your project, if applicable.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To change the domain of a Laravel project, you will need to perform the following steps: Update the domain name in the web server configuration: If you&#8217;re using Apache, edit the virtual host configuration file for the domain and update the &#8220;ServerName&#8221; and &#8220;ServerAlias&#8221; directives. If you&#8217;re using Nginx, update the &#8220;server_name&#8221; directive in the &#8230; <a title=\"how to change domain of laravel project ?\" class=\"read-more\" href=\"https:\/\/trysiteprice.com\/blog\/how-to-change-domain-of-laravel-project\/\" aria-label=\"Read more about how to change domain of laravel project ?\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6531","post","type-post","status-publish","format-standard","hentry","category-best-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>how to change domain of laravel project ? - TrySitePrice<\/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:\/\/trysiteprice.com\/blog\/how-to-change-domain-of-laravel-project\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"how to change domain of laravel project ? - TrySitePrice\" \/>\n<meta property=\"og:description\" content=\"To change the domain of a Laravel project, you will need to perform the following steps: Update the domain name in the web server configuration: If you&#8217;re using Apache, edit the virtual host configuration file for the domain and update the &#8220;ServerName&#8221; and &#8220;ServerAlias&#8221; directives. If you&#8217;re using Nginx, update the &#8220;server_name&#8221; directive in the ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/trysiteprice.com\/blog\/how-to-change-domain-of-laravel-project\/\" \/>\n<meta property=\"og:site_name\" content=\"TrySitePrice\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-21T18:08:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-21T18:21:53+00:00\" \/>\n<meta name=\"author\" content=\"Rahul Sahu\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/trysiteprice.com\/blog\/how-to-change-domain-of-laravel-project\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/trysiteprice.com\/blog\/how-to-change-domain-of-laravel-project\/\"},\"author\":{\"name\":\"Rahul Sahu\",\"@id\":\"https:\/\/trysiteprice.com\/blog\/#\/schema\/person\/358e04eeea4281deacad2f30c58e67f4\"},\"headline\":\"how to change domain of laravel project ?\",\"datePublished\":\"2023-02-21T18:08:45+00:00\",\"dateModified\":\"2023-02-21T18:21:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/trysiteprice.com\/blog\/how-to-change-domain-of-laravel-project\/\"},\"wordCount\":589,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/trysiteprice.com\/blog\/#organization\"},\"articleSection\":[\"Best\/Tutorial\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/trysiteprice.com\/blog\/how-to-change-domain-of-laravel-project\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/trysiteprice.com\/blog\/how-to-change-domain-of-laravel-project\/\",\"url\":\"https:\/\/trysiteprice.com\/blog\/how-to-change-domain-of-laravel-project\/\",\"name\":\"how to change domain of laravel project ? - TrySitePrice\",\"isPartOf\":{\"@id\":\"https:\/\/trysiteprice.com\/blog\/#website\"},\"datePublished\":\"2023-02-21T18:08:45+00:00\",\"dateModified\":\"2023-02-21T18:21:53+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/trysiteprice.com\/blog\/how-to-change-domain-of-laravel-project\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/trysiteprice.com\/blog\/how-to-change-domain-of-laravel-project\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/trysiteprice.com\/blog\/how-to-change-domain-of-laravel-project\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/trysiteprice.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"how to change domain of laravel project ?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/trysiteprice.com\/blog\/#website\",\"url\":\"https:\/\/trysiteprice.com\/blog\/\",\"name\":\"TrySitePrice\",\"description\":\"Free Website Value Calculator Tool\",\"publisher\":{\"@id\":\"https:\/\/trysiteprice.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/trysiteprice.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/trysiteprice.com\/blog\/#organization\",\"name\":\"TrySitePrice\",\"url\":\"https:\/\/trysiteprice.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/trysiteprice.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/trysiteprice.com\/blog\/wp-content\/uploads\/2021\/12\/cropped-trysiteprice-logo.png\",\"contentUrl\":\"https:\/\/trysiteprice.com\/blog\/wp-content\/uploads\/2021\/12\/cropped-trysiteprice-logo.png\",\"width\":395,\"height\":268,\"caption\":\"TrySitePrice\"},\"image\":{\"@id\":\"https:\/\/trysiteprice.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/trysiteprice.com\/blog\/#\/schema\/person\/358e04eeea4281deacad2f30c58e67f4\",\"name\":\"Rahul Sahu\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/trysiteprice.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/51f0f95f7b95665f62baed2211572165?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/51f0f95f7b95665f62baed2211572165?s=96&d=mm&r=g\",\"caption\":\"Rahul Sahu\"},\"sameAs\":[\"https:\/\/trysiteprice.com\/blog\"],\"url\":\"https:\/\/trysiteprice.com\/blog\/author\/rsahu4242_trysiteprice\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"how to change domain of laravel project ? - TrySitePrice","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:\/\/trysiteprice.com\/blog\/how-to-change-domain-of-laravel-project\/","og_locale":"en_US","og_type":"article","og_title":"how to change domain of laravel project ? - TrySitePrice","og_description":"To change the domain of a Laravel project, you will need to perform the following steps: Update the domain name in the web server configuration: If you&#8217;re using Apache, edit the virtual host configuration file for the domain and update the &#8220;ServerName&#8221; and &#8220;ServerAlias&#8221; directives. If you&#8217;re using Nginx, update the &#8220;server_name&#8221; directive in the ... Read more","og_url":"https:\/\/trysiteprice.com\/blog\/how-to-change-domain-of-laravel-project\/","og_site_name":"TrySitePrice","article_published_time":"2023-02-21T18:08:45+00:00","article_modified_time":"2023-02-21T18:21:53+00:00","author":"Rahul Sahu","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/trysiteprice.com\/blog\/how-to-change-domain-of-laravel-project\/#article","isPartOf":{"@id":"https:\/\/trysiteprice.com\/blog\/how-to-change-domain-of-laravel-project\/"},"author":{"name":"Rahul Sahu","@id":"https:\/\/trysiteprice.com\/blog\/#\/schema\/person\/358e04eeea4281deacad2f30c58e67f4"},"headline":"how to change domain of laravel project ?","datePublished":"2023-02-21T18:08:45+00:00","dateModified":"2023-02-21T18:21:53+00:00","mainEntityOfPage":{"@id":"https:\/\/trysiteprice.com\/blog\/how-to-change-domain-of-laravel-project\/"},"wordCount":589,"commentCount":0,"publisher":{"@id":"https:\/\/trysiteprice.com\/blog\/#organization"},"articleSection":["Best\/Tutorial"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/trysiteprice.com\/blog\/how-to-change-domain-of-laravel-project\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/trysiteprice.com\/blog\/how-to-change-domain-of-laravel-project\/","url":"https:\/\/trysiteprice.com\/blog\/how-to-change-domain-of-laravel-project\/","name":"how to change domain of laravel project ? - TrySitePrice","isPartOf":{"@id":"https:\/\/trysiteprice.com\/blog\/#website"},"datePublished":"2023-02-21T18:08:45+00:00","dateModified":"2023-02-21T18:21:53+00:00","breadcrumb":{"@id":"https:\/\/trysiteprice.com\/blog\/how-to-change-domain-of-laravel-project\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/trysiteprice.com\/blog\/how-to-change-domain-of-laravel-project\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/trysiteprice.com\/blog\/how-to-change-domain-of-laravel-project\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/trysiteprice.com\/blog\/"},{"@type":"ListItem","position":2,"name":"how to change domain of laravel project ?"}]},{"@type":"WebSite","@id":"https:\/\/trysiteprice.com\/blog\/#website","url":"https:\/\/trysiteprice.com\/blog\/","name":"TrySitePrice","description":"Free Website Value Calculator Tool","publisher":{"@id":"https:\/\/trysiteprice.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/trysiteprice.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/trysiteprice.com\/blog\/#organization","name":"TrySitePrice","url":"https:\/\/trysiteprice.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/trysiteprice.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/trysiteprice.com\/blog\/wp-content\/uploads\/2021\/12\/cropped-trysiteprice-logo.png","contentUrl":"https:\/\/trysiteprice.com\/blog\/wp-content\/uploads\/2021\/12\/cropped-trysiteprice-logo.png","width":395,"height":268,"caption":"TrySitePrice"},"image":{"@id":"https:\/\/trysiteprice.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/trysiteprice.com\/blog\/#\/schema\/person\/358e04eeea4281deacad2f30c58e67f4","name":"Rahul Sahu","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/trysiteprice.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/51f0f95f7b95665f62baed2211572165?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/51f0f95f7b95665f62baed2211572165?s=96&d=mm&r=g","caption":"Rahul Sahu"},"sameAs":["https:\/\/trysiteprice.com\/blog"],"url":"https:\/\/trysiteprice.com\/blog\/author\/rsahu4242_trysiteprice\/"}]}},"_links":{"self":[{"href":"https:\/\/trysiteprice.com\/blog\/wp-json\/wp\/v2\/posts\/6531","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trysiteprice.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trysiteprice.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trysiteprice.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/trysiteprice.com\/blog\/wp-json\/wp\/v2\/comments?post=6531"}],"version-history":[{"count":3,"href":"https:\/\/trysiteprice.com\/blog\/wp-json\/wp\/v2\/posts\/6531\/revisions"}],"predecessor-version":[{"id":6534,"href":"https:\/\/trysiteprice.com\/blog\/wp-json\/wp\/v2\/posts\/6531\/revisions\/6534"}],"wp:attachment":[{"href":"https:\/\/trysiteprice.com\/blog\/wp-json\/wp\/v2\/media?parent=6531"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trysiteprice.com\/blog\/wp-json\/wp\/v2\/categories?post=6531"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trysiteprice.com\/blog\/wp-json\/wp\/v2\/tags?post=6531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}