How to use ISODate in PHP/Laravel

In MongoDB Date objects are stored as a signed 64-bit integer representing the number of milliseconds since the Unix epoch (Jan 1, 1970). Not all database operations and drivers support the full 64-bit range. You may safely work with dates with years within the inclusive range 0 through 9999. ISODate is not supported by PHP/MongoDB […]

composer install using php5.6 instead of php7

PHP 7.x is the recent version of php, in some cases you may want to install application using composer and php56 while your system has php7.x installed on it. You ‘ll need to install php5.6 on arch linux you can install php 5.6 from aur by using yaourt or any other aur installer. After you […]

Fixing Magento 2 Readiness Check by local php.ini

Magento 2 heavily relies on the php.ini setting to make 100% sure that magento will run without any error. While installing magento 2 you may encounter “Readiness Check” Errors. The reasons for those errors are either you have not created local php.ini file for your project in the project folder or magento is unable to […]

Magento get dirs

Base Dir /htdocs/magento App Dir /app/ Code Dir /app/code Design Dir /app/design ETC Dir /app/etc Lib Dir /lib Locale Dir /app/locale Media Dir /media Skin Dir /skin Var Dir /var Tmp Dir /var/tmp Cache Dir /var/cache Log Dir /var/log Session Dir /var/session Upload Dir /media/upload Export Dir /var/export Module Specific Directories

Magento get urls

Get Base Url : Get Skin Url : (a) Unsecure Skin Url : (b) Secure Skin Url : Get Media Url : Get Js Url : Get Store Url : Get Current Url Get Url in cms pages or static blocks Get Base Url : Get Skin Url : Get Media Url : Get Store […]

PHP Sessions not transferring to next page?

There are multiple reasons why sessions are not transferring to next page but the most important thing is to check the urls of sender and receiver pages For example if you are sending session from non secure url http://www.example.com to a secure url https://www.exmaple.com this will not work

Rename a file if same already exists

While uploading a file you may want to check if a file already exists in target directory then create a new file instead of replacing and rename new file with an incremental no. Example some_dir/some_file.png already exists, and you try to upload a file with name some_file.png again, so it should be uploaded as some_dir/some_file1.png […]

Integrating stripe using stripe.js and stripe-php library

Stripe is getting popular as a payment processor because of its simplicity and PCI compliance. To meet with PCI standards your website shouldn’t send or store any credit card information to any where other than stripe, so to send credit card information directly to stripe we use stripejs. How it works Stripe.js collects credit card […]