Touching Parents Timestamps with “$touches” in Laravel

When you’d need to update updated_at field of parent model, you can just use $touches of Laravel eloquent. Let’s assume, you have Posts and each Post has multiple Comments.Then it’s one to many relationship between Post and Comments.If a user added a comment for the post, we should update updated_at of the post as well.We …

Trade-off running atomic daemons in Node.js

When you develop daemons that runs periodically in Node.js, you’d have some tricky issues.I have used to node-schedule npm package and I had several problems. As it runs by certain time interval, it could overlap each other as well as it will run another process without completing all jobs. For example, you have a daemon …

How to check connection status of websocket?

In web application development, you’d face a moment that need to check websocket connection status.For example, you’d have a situation that your web backend needs to check if users are active in the browser. It’s as very simple as you just need to check websocket property WebSocket.readyState. It has 4 possible values; “CONNECTING”, “OPEN”, “CLOSING”, “CLOSE”. …

Cezerin – Ecommerce Progressive Web Apps

Cezerin is React and Node.js based eCommerce platform. Allows creating a Progressive Web Apps. Built with: Node.js v8.9 React v16 Redux Express Babel WebPack 4 MongoDB Installation with GitHub with Docker How to deploy a Cezerin on Ubuntu 16.04 How to deploy a Cezerin on Ubuntu 18.04.1 (from GitHub) Requirements Node.js >= 8 MongoDB >= …

General steps to create the WP plugin with Google API integration

Sometimes we need to build the WP plugin with Google API integration. Here are the big image of the steps to create it. Create the project on the google developer console, and install proper Google Api Implement the Google Authentication module using Client Id and Client Secret which Google provides. Build the plugin consuming the …

Integrate migration and seeder in Laravel

When we develop Laravel projects, we typically separate migration files and seed files. But in production environment it’s convenient to integrate migration and seeder in 1 file. We normally need to update migration and seeders while developing projects but this causes a lot of problems especially because of foreign key constraint. We can avoid many …