Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Freazling's avatar

Laravel Breeze with HerokuApp

Hello everyone,

For a school assignment, I need to deploy a Laravel project on Heroku with a login system. I'm using a Laravel Breeze package for this. Now I'm having a problem with installing this package on Heroku. I used the "heroku run composer require laravel/breeze --dev" but it doesn't seem to work.

Is there someone in this forum with some knowledge about Heroku and Laravel? (Maybe this is the wrong forum)

Kind regards, Jan

0 likes
8 replies
martinbean's avatar

@freazling You shouldn’t be running Composer commands on your Heroku app. The app is served by “dynos” which means it doesn’t have a persistent disk. Any changes you make to an app in a dyno won’t be saved.

You should be running Composer commands in your local Laravel project, committing the changes with Git, and then pushing the app to Heroku.

Freazling's avatar

Thank you for your reply. I will look into this!

Freazling's avatar

Thank you for your reply. I will look into this aswell!

warpig's avatar

Install it locally and once you deploy it from your repo to your heroku app, you'll then need to save the config variables. However you must log in to bash and run php artisan migrate, for this you must be signed in to your Heroku account from the Terminal or CMD line via heroku login. After youu've migrated the tables it should work. But mind the config variables first, use the same ones you see on your .env now, in order to run a database system you'll need PGSQL which is a free add-on that comes with heroku.

  1. Install PGSQL
  2. Recuperate the credentials like DATABASE_URL, DATABASE_NAME, DATABASE_PASSWORD, DATABASE_USERNAME, etc
  3. Establish the config variables via the terminal or the front-end (in Heroku)
  4. Run your migrations

This is somehow how the flow of it goes. Hope it helps.

Freazling's avatar

Thank you for the reply. I have already set up my heroku (Might had to say that earlier). The problem is that the log in form doesn't have any CSS and it doesn't work (I have a screenshot, but I can't upload it yet)

martinbean's avatar

The problem is that the log in form doesn't have any CSS

@freazling Then you either need to build your assets locally with Mix and include it in your repository before pushing, or add the Node.js build pack and build your assets on push.

The former is easier, but the drawback is every time you change your styles you need to remember to commit the generated stylesheets.

Please or to participate in this conversation.