Deploy Laravel for Bitbucket Pipelines
View on GitHub

Step 5: Other configuration

  • Vite or Mix?

    By default, the script uses Vite to build your javascript bundle (as has been the default since Laravel 9). If you are still using Laravel Mix, change the line npm run build to npm run production in the bitbucket-pipelines.yml file.

  • Vite/Mix environment variables

    Laravel allows you to use variables from your .env file in your javascript bundle. These variables start with MIX_ or VITE_. In your javascript code they look like this: process.env.MIX_PUSHER_APP_KEY. If you use these types of variables, follow this post to configure them.

  • Using SQLite?

    When using SQLite, set the DB_DATABASE path to the root of your project, like this:

    project
    ├── .env
    ├── database.sqlite
    ├── current/
    ├── releases/
    └── storage/
    
  • You can't store the SQLite database file in the current directory, because that directory is replaced on each deployment (meaning you'd lose your database on each deployment).

  • Laravel Nova

    If you application uses Laravel Nova, follow the instructions in this post.