Some Useful Laravel Packages
In this article, I will be sharing some useful Laravel packages that I have developed by myself with their usage and documentation. Sri Lankan Universities This includes all Srilankan Universities,Faculties & Undergraduate Degree Programmes. Installations: 1composer require dinushchathurya/srilankan-universities Documentation Working Demo Srilankan Divisional Secretariat This includes all Srilankan Divisional Secretariats Installations: 1composer require...
Laravel Factories, Seeder
Today's tutorial, you will learn how to create dummy data in database using Laravel Factory and Seed the database by using Database Seeder. Generate model factory Firstly, you need to generate model factory. To generate model factory, run below command in your terminal: 1php artisan make:factory UserFactory --model=User This will create a new file called UserFactory.php in database/factories folder. Now we need to add fake data for each column in our model. For example, if we have a...
Send Email with NestJS
Today's tutorial, you will learn how Create Email Templates and send them with nodemailer from your Nest application. In here, I am using Nodemailer to send emails and Handlebars to create email templates, alternatively you can use pug or ejs for templating. Create new Nest application First upon, we need to create a new Nest application. To create a new Nest application, we will use the following command: 1nest new nestjs-mailer Then, we need to navigate to the newly created Nest...
How to setup Nginx as a reverse proxy for Apache on Ubuntu
Today's tutorial, you will learn how to set up Nginx as a reverse proxy server for Apache server on Ubuntu and Debian. I will assume that already you have an existing Apache web server. Using Nginx as a reverse proxy for Apache will allow both servers to work together and allow you to take advantage of the benefits of both servers and hide the actual server. You can easily monitor what traffic goes in and out through the reverse proxy. At the end of this tutorial, you will have a properly...
How to use GitLab CICD with GitHub Repository
Imagine that your all repos are hosted on GitHub but you wanna use GitLab's CI/CD for them instead of GitHub actions. So, in today's article, I am going to show you, how we can use GitLab CICD with GitHub Repository. Create GitHub Access Token To connect our GitHub Repositories with GitLab, we need to create a GitHub Access Token. You should have GitHub Owner Role to perfome this action To create a GitHub Access Token, follow the steps below: Go to your GitHub account and navigate to...
Laravel Passwordless Login
In this article, we are going to learn how to create a passwordless login system in Laravel. In here, we will use only the user's email address to register and login. In the registration, we will send a link to given email for email verification, while we will send login link everytime when user input email. Setting up the Project First you need to create a fresh laravel project by running below command in your terminal 1composer create-project laravel/laravel...
Laravel detect user device is Mobile, Dekstop or Tablet
Sometimes we need to know from which device user is logged in to out application and show different content to user based on their device. So in this tutorial we are going to learn how to detect user device is Mobile, Dekstop or Tablet and show the result based on the device. For this tutorial we are going to use a package called jenssegers/agent Setting up the Project First you need to create a new laravel project by running below command in your terminal 1composer create-project...
How to auto stop and auto start AWS EC2 instances using AWS Lambda
In our previous articles we learned how to create and launch and AWS EC2 instance and how we can connect it from your computer using the SSH protocol like PuTTY and how to assign Elastic IP to our EC2 instance. In this article we will learn how to automatically stop and start an AWS EC2 instance using AWS Lambda, we'll create Lambda function that stop and start your EC2 instances. This function will use Instance tags to identify which instances needs to be start and stop at intervals or...
How to assign an Elastic IP to EC2 instance
In our previous articles we learned how to create and launch and AWS EC2 instance and how we can connect it from your computer using the SSH protocol like PuTTY. But the problem is, every time you stop your EC2 instance and start it again, public IP of your instance changes. Now imagine if you are hosting your application on EC2 and the public IP changes. What is gonna happen? So one of the simplest solution is to attach an Elastic IP to your instance. So, in this tutorial, we are going to...
How to install Terraform on Windows
Terraform is infrastructure as code tool. With Terraform scripts we can automate the configuration of our infrastructure.In this tutorial, we are going to learn how to install Terraform on Windows. Download Terraform Firstly, you need to download Terraform from here. You can see the windows 32 bit and 64 bit source files. Download depends on your system here I am downloading 64 bit Terraform. It will be downloaded as zip file. Unzip the terraform package Create a directory called...