Skip to content

Environment variables

Mischa Braam edited this page Feb 16, 2024 · 2 revisions

See https://laravel.com/docs/10.x/valet#site-specific-environment-variables

An example of .valet-env.php can be;

<?php
  
return [
    'sitename1' => [
        'MAGE_RUN_CODE' => 'storecode1',
        'MAGE_RUN_TYPE' => 'store',
    ],
    'sitename2' => [
        'MAGE_RUN_CODE' => 'storecode2',
        'MAGE_RUN_TYPE' => 'store',
    ],
];

A couple of notes:

  • sitename1 is the folder name within your Valet+ parked folder with the multi-store Magento installation.
  • Use valet link sitename2 within the same folder as sitename1 to also link sitename2.test to the same installation.
  • Make sure you update the base URLs within Magento's config.
Clone this wiki locally