This article will briefly show you how to use Docker for Laravel and MySQL application.

Create a .docker folder right inside the project’s root folder.

Then create a Dockerfile file with the following content.

FROM php:7.4.1-apacheUSER rootWORKDIR /var/www/htmlRUN apt-get update && apt-get install -y \libpng-dev \zlib1g-dev \libxml2-dev \libzip-dev \libonig-dev \zip \curl \unzip \&& docker-php-ext-configure gd \&& docker-php-ext-install -j$(nproc) gd \&& docker-php-ext-install pdo_mysql \&& docker-php-ext-install mysqli \&& docker-php-ext-install zip \&& docker-php-source deleteCOPY .docker/vhost.conf /etc/apache2/sites-available/000-default.confRUN curl -sS https://getcomposer.org/installer | php — — install-dir=/usr/local/bin…

If you are a React developer, you have probably heard about React hooks, https://reactjs.org/docs/hooks-intro.html. Developing React application using State Reducer Pattern is now becoming a trend. If you are using this pattern, you will be using functional components and React context API. This article will show you how to use React Context API to manage the global state and access it from the child functional components.

One scenario we might need to use Context API is that if our application is supporting multiple languages and we need to share the state related to language data across components. For example, all…


Hi, I am Wai. I am a software developer who is a big fan of AWS CloudFormation. In this article, I will show you how to resolve one of the issues I experienced using AWS CloudFormation service which is Circular Dependency.

First, let’s try to understand what the problem is.

Let’s imaging you have multiple CloudFormation templates, called core.yaml and resources.yaml. The core.yaml template will be importing the resources from resources.yaml template which is the core.yaml template is depending on the resources.yaml template. We will need to deploy the resources.yaml before the core.yaml.

The following is the dummy resources.yaml template.


This quick article will show you how to configure Redis on Docker in Laravel for caching.

First, you need to install the Predis library running the following composer command.

composer require predis/predis

Then you need to declare the Redis image in the docker-compose.yml file as follow.

redis:
image: redis:4.0
container_name: app_redis
ports:
- "6382:6379"
networks:
- app-network

As you can see, it is on a network called app-network so that we need to declare the network in the docker-compose.yml file too as follow.

networks:
app-network:
driver: "bridge"

Then we need to set the environment variables in the .env …


This short article will show you how to use Redis on Docker (docker-compose.yml) and how to connect in in the PHP. We are using the Predis library so that we need to install the dependency first by running the following composer command.

composer require predis/predis

Then we need to put the Redis image in our docker-compose.yml file as follow.

redis:
image: redis:4.0
container_name: app_redis
ports:
- "6382:6379"
networks:
- app-network

As you can see, It is on the app-network, so that I will need to declare the network too.

networks:
app-network:
driver: "bridge"

If we spin up the docker, the…


This article will show you how to deploy a simple Node JS application to ElasticBeanstalk using CloudFormation. Most of the process is done using the template and CLI. You will need to have AWS command line installed and IAM credentials configured for your laptop.

First, you will need to login to the AWS console and create an S3 bucket to store your template.


First thing first, let me introduce myself. I am an experienced Software Engineer currently based in the UK. I am originally from Myanmar and I also used to work in Myanmar and Singapore as Full-Stack Software Engineer before I moved to the UK. If you want to reach me out, here is my LinkedIn profile, https://www.linkedin.com/in/wai-yan-hein-b99162123/.

This article will show you how to upload multiple files in GraphQL using Lighthouse library in Laravel. I assume you have basic knowledge about Laravel, GraphQL and Lighthouse PHP library.

This is the library we are using, https://lighthouse-php.com/. You will need to follow the…


This article is the continuation of the previous article I published, https://medium.com/@waihein/setting-up-laravel-react-js-spa-application-decf269ed3b3. So I recommend going through the previous article before you continue because we will be installing Redux on the project from the previous article.

Install the required npm dependencies.

  • npm install react-redux redux redux-thunk redux-devtools-extension axios

Then create a store.js file under resources/js/superadmin/ folder with the following content.

import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import { composeWithDevTools } from 'redux-devtools-extension';
import reducers from './reducers';
const store = createStore(reducers, composeWithDevTools(applyMiddleware(thunk)));

export default store;

Then update the app.js with the following content.

require('../bootstrap');

import React from…


This article will show you how to configure a Laravel project to build a SPA application using React JS. I assume you are already familiar with the Laravel framework and React JS to a certain extent.

First, you need to install the Laravel application. You can following the installation guidelines mentioned on the official Laravel documentation page, https://laravel.com/docs/7.x/installation.

Then in the project root folder, you need to run the following commands.

  • npm install
  • php artisan ui react (If your Laravel version is lower than 7, you need to run “php artisan preset react” instead)
  • npm install && npm run dev

Wai Hein

Software Developer based in the UK, used to work in Singapore, but originally from Myanmar.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store