A few Laravel 4.1 Update Gotchas

Update (12/12/1013): One of the headaches with the upgrade to Production was waiting for ‘composer update’ to run while the site was down due to the skeleton and framework being out of sync. However, I’ve just realized that I should be pushing my composer.lock file to prod and just running ‘composer install’, which is much faster and makes sure your packages are in sync across environments. Doh!

I have a bad habit of being an early adopter. Mavericks? Sign me up! New iPhone, I’m there!

So when Laravel 4.1 was release a few hours ago, I had to jump in and update some apps. Upgradeing frameworks will probably never be as easy as upgrading WordPress, et al., but the changes to the Laravel app skeleton are pretty minor. However, once that’s done, there are few things to watch out for:

  • After making the skeleton changes, the change to composer.json (“laravel/framework”: “4.0.*” to “laravel/framework”: “4.1.*”) and running ‘composer update install’ on my Dev and Test environments, everything was fine. But once I did the same in Production (no!), I got this:
    Error Output: PHP Fatal error:  Call to undefined method Illuminate\Foundation\Application::bindShared()

    The error referenced bootstrap/compiled.php, so the fix was just to remove it, then re-run ‘composer update install’, with the the environment difference being that Dev and Test don’t create that file.
  • Then in another app (not sure why this wasn’t a consistent issue), I got this when running ‘composer update install’:
    ssage":"Class 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider'
    not found"...

    Once again, I deleted ‘compiled.php’, but I also need to remove
    "post-install-cmd": [
    "php artisan optimize"
    "pre-update-cmd": [
    "php artisan clear-compiled"

    from composer.json. (it turns out, you can run ‘composer update install’ with ‘–no-scripts’ to achieve the same.)
    After running the update, I added these lines back.
  • Last but not least, 4.1 includes something called FrameGuard that is enabled by default. This prevents cross-domain iframe embeds. I maintain two apps for which providing iframe video embed code is vital, so it would have been nice to know this would be the default have when I upgraded. Adding 
    to bootstrap/start.php right before
    return $app;
    disables this behavior.
  • Juukie14

    So when you’re having youtube iframes you’ll have to add the App::forgetMiddleware() line?

    • Barryvdh

      No, just when you want people to embed your site as an iframe, on their own site.

      • Juukie14

        Ok, now it makes sence to me. Thanks

  • http://thereluctantdeveloper.com/ Gary Taylor

    @Junkie14: No, this is for when you are providing content in an iframe from your application to other domains, i.e., the src attribute points to your domain from another web site.

  • Johnny

    I use this in order for my booking application to be accessable via iframe on my clients websites. So it’s basically to let anyone access your laravel website through an iframe.