Understanding SOLID using PHP
SOLID is a set of principles in object-oriented programming that, when followed, can lead to more maintainable and scalable software. SOLID is an acronym, and each letter represents one of the principles. Let’s go through each principle with examples in PHP: 1. Single Responsibility Principle (SRP): A class should have only one reason to change….
Deploying Laravel-Vue.JS on AWS EC2 Instance (Ubuntu)
Nowadays, developers don’t only code, they also need knowledge of server configuration, deployment, CI/CD etc. As a Full Stack Developer, I also had to learn some basics of server configuration. In this article I will discuss and mainly write necessary linux commands that I used to configure and deploy my Laravel-Vue.js project. I have divided…
Unleashing the Power of JavaScript Spread Operator
JavaScript, a versatile and dynamic programming language, introduces a powerful feature known as the spread operator (…). This seemingly simple syntax is a game-changer, providing developers with concise and efficient ways to manipulate arrays, objects, and function arguments. In this blog post, I’ll explore the various use cases and benefits of the spread operator in…
Enum in PHP
Although the concept of enums is not novel in programming, PHP introduced this feature relatively recently, with its 8.1 version. Now, let’s explore the possibilities it offers. Enum in PHP is declared in this way: enum OrderStatus { case PENDING; case CONFIRMED; case SHIPPED; case DELIVERED; case CANCELLED; } So it represents a collection of…
Simple way to configure vue.js (axios, pinia) to work with Laravel Sanctum Token based auth
Laravel Sanctum gives a simple mechanism of authentication for SPAs (Single Page Applications). There are basically two ways Sanctum can be used. 1. API Tokens: Sanctum can generate token for an authenticated user and that token can be used everytime for subsequent requests. 2. SPA Authentication: For this functionality, Sanctum avoids the use of tokens…