Laravel 5.6 Will Remove the Artisan Optimize Command

Laravel 5.6 Will Remove the Artisan Optimize Command

The Artisan optimize command is deprecated as of 5.5, and a commit in master has already removed it from 5.6. Waiting until 5.6 gives you time to update your build scripts and composer.json files ahead of the release.

As of Laravel 5.5, the composer.json no longer references optimize in the post-install-cmd and post-update-cmd scripts. The Optimize command is still defined, but does nothing in 5.5.

The 5.5 upgrade guide explains the reason for the deprecation:

With recent improvements to PHP op-code caching, the optimize Artisan command is no longer needed. You should remove any references to this command from your deployment scripts as it will be removed in a future release of Laravel.

You can see the removal in master and more discussion around the removal, where Taylor Otwell had this to say about the timing:

We’ll remove it in 5.6 and note in the upgrade guide for 5.5. It can break deployment scripts that are calling it if we remove it without warning.

Laravel 5.5 also requires PHP 7, so you should be safe to remove any reference to this command now if you’ve upgraded. Be sure to remove the command from your composer.json post-install-cmd and post-update-cmd scripts ahead of the 5.6 release next year.


Filed in: Laravel 5.6 / Artisan


Newsletter

Join the weekly newsletter and never miss out on new tips, tutorials, and more.

Laravel News Partners

Laravel Jobs

Senior PHP Developer (Full Stack | CakePHP | Laravel | Vue | jQuery)
Remote
continued
Senior Laravel Developer (Full-Stack)
Munich
Volunteer Vision GmbH
Full-Stack Developer
Tampa
Nu Image Medical
Senior Software Developer
Remote (US ONLY)/Kenilworth, NJ
Diversified
Senior Back-end Laravel API Developer - Immediate Contract (Full Time)
Remote
ApproveMe // Document Signing
Web Development Project Manager
Houston, TX
Swyft Filings
Experienced Laravel/VueJS Developer (Freelance)
Remote (preferably in the US)
Prosperly LLC