How I configure Laravel Homestead after installing it on Mac

geometric shape digital wallpaper

Each time after updating or installing Laravel Homestead I take these steps.

  1. (Step 1) Add Homestead to Firefox & Chrome
  2. (Step 2)  Fix Max Packet Size MySQL
  3. (Step 3)  Disable strict database date settings in MySQL
  4. (Step 4) Import and configure Postgres databases
  5. (Step 5) Set the max upload size of nginx.
  6. (Step 6) Set the timezone sudo timedatectl set-timezone America/New_York

Other Details

I use PHPStorm during development and the PHPUnit tools built into the Jetbrains’ IDE. When configuring tests I like to target only specific testsuites using the argument –testsuite in the “Test Runner options” section of PHPStorm.

For example, I can target the Models testsuite of this phpunit.xml file by specifying --testsuite Models.

<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
         backupStaticAttributes="false"
         bootstrap="bootstrap/autoload.php"
         colors="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         processIsolation="false"
         stopOnFailure="false">
    <testsuites>
        <testsuite name="Models">
            <directory suffix="Test.php">./tests/Models</directory>
        </testsuite>
        <testsuite name="PayPal">
            <directory suffix="Test.php">./tests/PayPal</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">./app</directory>
        </whitelist>
    </filter>
    <groups>
        <exclude>
            <group>integration</group>
        </exclude>
    </groups>
    <php>
        <env name="APP_ENV" value="testing"/>
        <env name="CACHE_DRIVER" value="array"/>
        <env name="SESSION_DRIVER" value="array"/>
        <env name="QUEUE_DRIVER" value="sync"/>
        <env name="DB_PORT" value="54320"/>
        <env name="DB_HOST" value="127.0.0.1"/>
    </php>
</phpunit>

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.