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

Leteo's avatar
Level 1

application does not find model php class with relationship

Hello, today I had a really strange error after uploading the site to the production server. One blade page was complaining that it could not find a model php class due to a missing relationship. I did everything as usual, migrate new columns, update cache, but the problem with the last version the application persists for this view. I reproduced the procedure in another test machine, and everything was fine. The only thing, I can think of is, that a previous version of the site is somehow/somewhere cached, an not all the changes get it through the upload. But, this is also strange. Have you had a similar issue?

0 likes
2 replies
tuneless's avatar

When deploying to production I always clear all caches.

My standard post-update-cmd:

    "post-update-cmd": [
      "Illuminate\\Foundation\\ComposerScripts::postUpdate",
      "php artisan optimize",
      "php artisan cache:clear",
      "php artisan view:clear",
      "php artisan queue:restart"
    ]
Leteo's avatar
Level 1

Thank you tuneless, If I put this in my code, does it run automatically?

Please or to participate in this conversation.