{"id":348,"date":"2018-02-25T18:08:48","date_gmt":"2018-02-25T18:08:48","guid":{"rendered":"https:\/\/alexrusin.com\/?p=348"},"modified":"2018-02-25T18:12:35","modified_gmt":"2018-02-25T18:12:35","slug":"using-local-and-public-disks","status":"publish","type":"post","link":"https:\/\/blog.alexrusin.com\/using-local-and-public-disks\/","title":{"rendered":"Using Local and Public Disks"},"content":{"rendered":"

Having vagrant run on Windows host machine may cause some problems with symbolic links. After trying to make symbolic links to work and failing, I decided to use public disk in development and local disk in production.<\/p>\n

php artisan storage:link\u00a0<\/strong>makes\u00a0symbolic link from “public\/storage” to “storage\/app\/public”.\u00a0 When developing on windows-vagrant this command will not work properly, however it works on the production Ubuntu server. The solution is not to run this command in development and swap local disk with public during development. <\/p>\n

\r\n\/* config\/filesystems.php *\/\r\nreturn [\r\n    'default' => env('FILESYSTEM_DISC', 'local'),\r\n\r\n    'disks' => [\r\n\r\n        'local' => [\r\n            'driver' => 'local',\r\n            'root' => storage_path('app\/public'),\r\n        ],\r\n\r\n        'public' => [\r\n            'driver' => 'local',\r\n            'root' => public_path('storage'),\r\n            'url' => env('APP_URL').'\/storage',\r\n            'visibility' => 'public',\r\n        ]\r\n    ]\r\n]\r\n<\/pre>\n
\r\n# .env file in development\r\nFILESYSTEM_DISC=public\r\n\r\n# .env file in production\r\nFILESYSTEM_DISC=local\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

Having vagrant run on Windows host machine may cause some problems with symbolic links. After trying to make symbolic links to work and failing, I decided to use public disk in development and local disk in production. php artisan storage:link\u00a0makes\u00a0symbolic link from “public\/storage” to “storage\/app\/public”.\u00a0 When developing on windows-vagrant this command will not work properly,…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[12],"tags":[],"class_list":["post-348","post","type-post","status-publish","format-standard","hentry","category-laravel"],"yoast_head":"\nUsing Local and Public Disks | Alex Rusin Blog<\/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:\/\/blog.alexrusin.com\/using-local-and-public-disks\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using Local and Public Disks | Alex Rusin Blog\" \/>\n<meta property=\"og:description\" content=\"Having vagrant run on Windows host machine may cause some problems with symbolic links. After trying to make symbolic links to work and failing, I decided to use public disk in development and local disk in production. php artisan storage:link\u00a0makes\u00a0symbolic link from “public\/storage” to “storage\/app\/public”.\u00a0 When developing on windows-vagrant this command will not work properly,...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.alexrusin.com\/using-local-and-public-disks\/\" \/>\n<meta property=\"og:site_name\" content=\"Alex Rusin Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-02-25T18:08:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-02-25T18:12:35+00:00\" \/>\n<meta name=\"author\" content=\"alexrusin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"alexrusin\" \/>\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:\/\/blog.alexrusin.com\/using-local-and-public-disks\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/blog.alexrusin.com\/using-local-and-public-disks\/\"},\"author\":{\"name\":\"alexrusin\",\"@id\":\"https:\/\/blog.alexrusin.com\/#\/schema\/person\/a9005ca622862109b2c514050fbaaf9a\"},\"headline\":\"Using Local and Public Disks\",\"datePublished\":\"2018-02-25T18:08:48+00:00\",\"dateModified\":\"2018-02-25T18:12:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/blog.alexrusin.com\/using-local-and-public-disks\/\"},\"wordCount\":92,\"publisher\":{\"@id\":\"https:\/\/blog.alexrusin.com\/#\/schema\/person\/a9005ca622862109b2c514050fbaaf9a\"},\"articleSection\":[\"Laravel\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.alexrusin.com\/using-local-and-public-disks\/\",\"url\":\"https:\/\/blog.alexrusin.com\/using-local-and-public-disks\/\",\"name\":\"Using Local and Public Disks | Alex Rusin Blog\",\"isPartOf\":{\"@id\":\"https:\/\/blog.alexrusin.com\/#website\"},\"datePublished\":\"2018-02-25T18:08:48+00:00\",\"dateModified\":\"2018-02-25T18:12:35+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/blog.alexrusin.com\/using-local-and-public-disks\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.alexrusin.com\/using-local-and-public-disks\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.alexrusin.com\/using-local-and-public-disks\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/blog.alexrusin.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using Local and Public Disks\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.alexrusin.com\/#website\",\"url\":\"https:\/\/blog.alexrusin.com\/\",\"name\":\"Alex Rusin\",\"description\":\"Web Development Blog\",\"publisher\":{\"@id\":\"https:\/\/blog.alexrusin.com\/#\/schema\/person\/a9005ca622862109b2c514050fbaaf9a\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.alexrusin.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/blog.alexrusin.com\/#\/schema\/person\/a9005ca622862109b2c514050fbaaf9a\",\"name\":\"alexrusin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/blog.alexrusin.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c36ef231f9e0b11371891eb84360f4bc?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c36ef231f9e0b11371891eb84360f4bc?s=96&d=mm&r=g\",\"caption\":\"alexrusin\"},\"logo\":{\"@id\":\"https:\/\/blog.alexrusin.com\/#\/schema\/person\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using Local and Public Disks | Alex Rusin Blog","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:\/\/blog.alexrusin.com\/using-local-and-public-disks\/","og_locale":"en_US","og_type":"article","og_title":"Using Local and Public Disks | Alex Rusin Blog","og_description":"Having vagrant run on Windows host machine may cause some problems with symbolic links. After trying to make symbolic links to work and failing, I decided to use public disk in development and local disk in production. php artisan storage:link\u00a0makes\u00a0symbolic link from “public\/storage” to “storage\/app\/public”.\u00a0 When developing on windows-vagrant this command will not work properly,...","og_url":"https:\/\/blog.alexrusin.com\/using-local-and-public-disks\/","og_site_name":"Alex Rusin Blog","article_published_time":"2018-02-25T18:08:48+00:00","article_modified_time":"2018-02-25T18:12:35+00:00","author":"alexrusin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"alexrusin","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.alexrusin.com\/using-local-and-public-disks\/#article","isPartOf":{"@id":"https:\/\/blog.alexrusin.com\/using-local-and-public-disks\/"},"author":{"name":"alexrusin","@id":"https:\/\/blog.alexrusin.com\/#\/schema\/person\/a9005ca622862109b2c514050fbaaf9a"},"headline":"Using Local and Public Disks","datePublished":"2018-02-25T18:08:48+00:00","dateModified":"2018-02-25T18:12:35+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.alexrusin.com\/using-local-and-public-disks\/"},"wordCount":92,"publisher":{"@id":"https:\/\/blog.alexrusin.com\/#\/schema\/person\/a9005ca622862109b2c514050fbaaf9a"},"articleSection":["Laravel"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/blog.alexrusin.com\/using-local-and-public-disks\/","url":"https:\/\/blog.alexrusin.com\/using-local-and-public-disks\/","name":"Using Local and Public Disks | Alex Rusin Blog","isPartOf":{"@id":"https:\/\/blog.alexrusin.com\/#website"},"datePublished":"2018-02-25T18:08:48+00:00","dateModified":"2018-02-25T18:12:35+00:00","breadcrumb":{"@id":"https:\/\/blog.alexrusin.com\/using-local-and-public-disks\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.alexrusin.com\/using-local-and-public-disks\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.alexrusin.com\/using-local-and-public-disks\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.alexrusin.com\/"},{"@type":"ListItem","position":2,"name":"Using Local and Public Disks"}]},{"@type":"WebSite","@id":"https:\/\/blog.alexrusin.com\/#website","url":"https:\/\/blog.alexrusin.com\/","name":"Alex Rusin","description":"Web Development Blog","publisher":{"@id":"https:\/\/blog.alexrusin.com\/#\/schema\/person\/a9005ca622862109b2c514050fbaaf9a"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.alexrusin.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/blog.alexrusin.com\/#\/schema\/person\/a9005ca622862109b2c514050fbaaf9a","name":"alexrusin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.alexrusin.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c36ef231f9e0b11371891eb84360f4bc?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c36ef231f9e0b11371891eb84360f4bc?s=96&d=mm&r=g","caption":"alexrusin"},"logo":{"@id":"https:\/\/blog.alexrusin.com\/#\/schema\/person\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/blog.alexrusin.com\/wp-json\/wp\/v2\/posts\/348","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.alexrusin.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.alexrusin.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.alexrusin.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.alexrusin.com\/wp-json\/wp\/v2\/comments?post=348"}],"version-history":[{"count":3,"href":"https:\/\/blog.alexrusin.com\/wp-json\/wp\/v2\/posts\/348\/revisions"}],"predecessor-version":[{"id":351,"href":"https:\/\/blog.alexrusin.com\/wp-json\/wp\/v2\/posts\/348\/revisions\/351"}],"wp:attachment":[{"href":"https:\/\/blog.alexrusin.com\/wp-json\/wp\/v2\/media?parent=348"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.alexrusin.com\/wp-json\/wp\/v2\/categories?post=348"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.alexrusin.com\/wp-json\/wp\/v2\/tags?post=348"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}