{"id":1666,"date":"2018-09-22T14:09:37","date_gmt":"2018-09-22T12:09:37","guid":{"rendered":"http:\/\/www.kavdesign.net\/blog\/?p=1666"},"modified":"2018-09-29T12:27:39","modified_gmt":"2018-09-29T10:27:39","slug":"configure-laravel-and-artisan-to-work-properly","status":"publish","type":"post","link":"https:\/\/www.kavdesign.net\/blog\/coding\/configure-laravel-and-artisan-to-work-properly\/","title":{"rendered":"Configure Laravel and Artisan to work properly on Windows and XAMPP"},"content":{"rendered":"<p>After you install Laravel like described on the <a href=\"https:\/\/www.kavdesign.net\/blog\/coding\/how-to-install-laravel-on-windows-xampp\/\">previous post<\/a>.<\/p>\n<p>You may need to configure some stuff.<\/p>\n<ol>\n<li><strong>Configure XAMPP home directory.<\/strong> Go to XAMPP controll panel on the Apache module -&gt; click config and open httpd.conf file -&gt; Search for htdocs and change DocumentRoot and Directory to C:\/xampp\/htdocs\/laravel\/myprojectname\/public (just put the full public path to your Laravel installation);<\/li>\n<li><strong>Set up the Laravel environment.<\/strong> Go to C:\\xampp\\htdocs\\laravel\\myprojectname and open .env file and put the DB, User and Pass to the ones that you will use.<\/li>\n<li><strong>Enable the Artisan commands.<\/strong>We need to add a new system variable with the PHP path of our XAMPP installation. Go to Control Panel\\All Control Panel Items\\System -&gt; Advanced system settings -&gt; Advanced tab -&gt; Environment variables -&gt; System variables -&gt; new -&gt; Call the new variable &#8216;Artisan&#8217; and add the path &#8216;C:\\xampp\\php&#8217; -&gt; OK.\n<p>See the video for details:<br \/>\n<iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/GZfq_FUiOHI\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/li>\n<li>In order for your database migrations to work properly on XAMPP and MySQL -&gt; go to app\/Providers\/AppServiceProvider.php and add:\n<pre>use Illuminate\\Support\\Facades\\Schema;<\/pre>\n<p>also put this line into the boot method:<\/p>\n<pre>public function boot()\r\n{\r\n    Schema::defaultStringLength(191);\r\n}<\/pre>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>After you install Laravel like described on the previous post. You may need to configure some stuff. Configure XAMPP home directory. Go to XAMPP controll&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/www.kavdesign.net\/blog\/coding\/configure-laravel-and-artisan-to-work-properly\/\">Continue reading<span class=\"screen-reader-text\">Configure Laravel and Artisan to work properly on Windows and XAMPP<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[9,445],"tags":[430],"class_list":["post-1666","post","type-post","status-publish","format-standard","hentry","category-coding","category-laravel","tag-laravel","entry"],"_links":{"self":[{"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/posts\/1666","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/comments?post=1666"}],"version-history":[{"count":6,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/posts\/1666\/revisions"}],"predecessor-version":[{"id":1672,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/posts\/1666\/revisions\/1672"}],"wp:attachment":[{"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/media?parent=1666"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/categories?post=1666"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/tags?post=1666"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}