Posts

Laravel 8 Upgrade Strategy

Recently me and my team has been working on Laravel 8 upgrade from Laravel 7. To facilitate the upgrade we decided to use Laravel Shift . After reviewing the initial PR created by Laravel Shift, we decided that it would be too risky to make all the changes done by Laravel Shift at once.  Luckily Laravel Shift also provides a Laravel Workbench if you get the yearly subscription for 99 USD/yr for latest version upgrade. By latest version they mean that as long as Laravel 8 is available, upgrades from Laravel 7 to Laravel 8 would be covered under this subscription. Once Laravel 9 is release, upgrades from Laravel 8 to Laravel 9 will be convered also under this subscription.  Laravel Workbench can be used to run different tasks e.g. Upgrade to Laravel Mix 6, Class Based Routes etc. So we decided to go with the following approach: - Upgrade Laravel Mix to 6 This went pretty smoothly. - Upgrade Routes to Class Based Routes For resource based controllers we ran into a problem in which test ca

Useful Tools for Monitoring Your Applications

During the last year or so me and my team have worked a lot in setting up monitoring and alerts for our applications in production so that we can work on fixing the issues proactively rather than react to issues reported by our end clients. We are so far using the following tools: Newrelic Infrastructure Alerts - We have setup infrastructure alerts to report any issues related to high cpu usage, high memory usage, low disk space and host not reporting. APM Logging Cost - Its FREE to use for up to 100GB / month which is a fantastic offer to evaluate the toolset provided by Newrelic. healthchecks.io Using it to monitor status of our crons UptimeRobot Using it to monitor status of our websites. All of these tools integrate with Slack which is a big plus. In case you guys need some more information regarding our setup, please feel free to send me a message on LinkedIn @ https://www.linkedin.com/in/omariqbalnaru/

Laravel Tip: Saving/Updating Eloquent model with associated entities with single line of code

Imagine you have two entities Employees and Department. Usually if you want to update something in department and its associated employee you will do something like this: However you save all associated relationships in a single line with just: $department->push(); Source:  https://laravel.com/docs/8.x/eloquent-relationships#the-push-method