Skip to content

Instantly share code, notes, and snippets.

@antonioribeiro
Created November 9, 2019 19:24
Show Gist options
  • Select an option

  • Save antonioribeiro/fddc8a7accf23ae013a13000c78fbfd8 to your computer and use it in GitHub Desktop.

Select an option

Save antonioribeiro/fddc8a7accf23ae013a13000c78fbfd8 to your computer and use it in GitHub Desktop.

Revisions

  1. antonioribeiro created this gist Nov 9, 2019.
    26 changes: 26 additions & 0 deletions samesite.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    // in your .env file, split APP_URL to extract protocol and hostname

    APP_PROTOCOL=https
    APP_HOSTNAME=myapp.test
    APP_URL="${APP_PROTOCOL}://${APP_HOSTNAME}"

    // install dotenv

    npm install dotenv

    // load it in your webpack.mix.js

    require('dotenv').config()

    // configure the LiveReload plugin to use the protocol && hostname you have on your .env file

    new LiveReloadPlugin({
    protocol: process.env.APP_PROTOCOL
    hostname: process.env.APP_HOST
    }),

    // Change your template to use app.url instead

    @if(app()->environment() === 'local')
    <script src="{{ config('app.url') }}:35729/livereload.js"></script>
    @endif