Similar Posts
Running Artisan Command as a Separate PHP Process in Laravel
In Laravel framework you can create commands and call them from php application. One command can call another command, and another command, and so on. But if an exception is thrown in one of the commands in this chain the whole chain breaks. In order to avoid this problem and run each artisan command as…
Magento 2 Data Migration Notes
Recently I was assigned to do data migration from Magento 1.8.1.0 to Magento 2.1.0 In this article, I will share some points you must look out for when migrating to Magento 2. There are several things you must be aware of before you start migration: Magento 2 is a memory hog. So, suggested 2GB RAM…
API Client Design
When you extensively work with certain APIs, like Shopify’s for example, you will end up with bunch of functions that map to API’s endpoints. One of the approaches I have seen so far is to create an API class ShopifyApi and make those functions class methods. So it looks something like the figure below. I…
Exporting Records with Timezone Adjustments
As a rule, dates in a database are stored in UTC. So, when you export records from database constrained by dates, it is a good idea to use appropriate timezone in export query. You can do it in one of two ways. One way is create incoming dates in user’s timezone, then covert time to…
Adding Email Headers in Laravel Application
Adding email headers in Laravel application is quite simple. SwiftMessage can be customized using withSwiftMessage method of Mailable base class: https://laravel.com/docs/8.x/mail#customizing-the-swiftmailer-message However you have to remember to do it every time you create a new “mailable” class. Some mail APIs require you to put a special header each time you send an email. In this…
Custom Mail Driver for Laravel
Out of the box Laravel supports many mail drivers, such as smtp, sendmail, mailgun, log, array, etc. But what if you wold like to use a mail service that Laravel does not have a driver for, such as Mailjet? You can create a custom driver for that service. This article will describe how to create…