From Zero to Confident API Dev using JWT and Laravel

From Zero to Confident API Dev using JWT and Laravel

owdy, Are you a Laravel dev? Or learning Laravel in deep? Then you must hear the term API, right? API (Application Programming Interface) is a very common thing nowadays in the world of software development. Modern web applications can’t think of it. It's a great medium for data sharing and data authenticity. If you are/want to be a backend developer, learning to integrate API is a must. But how to make them? From Zero to Confident API Dev using JWT and Laravel

Howdy, Are you a Laravel dev? Or learning Laravel in deep? Then you must hear the term API, right? API (Application Programming Interface) is a very common thing nowadays in the world of software development. Modern web applications can’t think of it. It's a great medium for data sharing and data authenticity. If you are/want to be a backend developer, learning to integrate API is a must. But how to make them?

As API is an intermediate level concept, I am assuming you are pretty familiar with  PHP and  Object-Oriented Programming (OOP),  Composer and you build/started building pieces of stuff using  Laravel. If you’re not familiar with them I highly recommend you to learn them first. For a clear understanding, I broke down this tutorial into two parts. In this part, I will discuss the concept/methodology behind API building and JWT. And in the part 2, I will implement them using JWT and Laravel. If you have a basic concept of them, you can skip this part and move on to the next part.

So what is API?

API is the acronym for Application Programming Interface, which is a software intermediary that allows two applications to talk to each other. Each time you use an app like Facebook, send an instant message or check the weather on your phone, you’re using an API. It’s a way of data communication. It lets you share/store/validate data from your application to other applications and vice versa. If you want to share some data publicly/privately to some other application, will you let them modify/access your database? Of course, not, there comes the vital role of API. You can share an endpoint to others where they can store/retrieve data with proper validation and authentication.

Before we dive deep, let's clear some core concepts and processes to authenticate _a user using API. So now comes the question, what is authentication? I often see people get confused between **_authorization** and authentication.

Let’s imagine a scenario. You joined/work in an IT company. Whenever you try to enter your office you need to _**_pass_ the main gate of the building and a guard sitting there _asks_ your identity so that he can be sure that you belong to this office. You somehow(showing you ID card/finger punch) managed to _prove_ your _identity_ and get inside the office building. Now you got a cabin/desk of your own and went there started working. After some time you thought to take a coffee break and went to the canteen/food court of your office. After that, you wanted to look at the server room of the IT department and you got _stopped_ and asked to _verify __yourself once again as the room is __only open_ for a _few people_. As you don’t have _access**_ there, you returned to your desk and started working again._

laravel jwt api authentication php

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Laravel 8 REST API Authentication with Passport Example Tutorial

Laravel 8 api authentication with passport. In this tutorial, we will show you how to build rest api authentication with passport in laravel 8

Laravel 7 File Upload Via API Example From Scratch

Uploading files via API using postman in laravel. Here, you will learn how to upload files or images via API using postman app or ajax in laravel app.

Laravel 8 JWT Rest API Authentication Example Tutorial

Laravel 8 JWT API authentication example. In this tutorial, you will learn how to build the rest APIs with jwt (JSON web token) authentication in laravel 8.

Top 10 API Security Threats Every API Team Should Know

Learn what are the most important API security threats engineering leaders should be aware of and steps you can take to prevent them

Laravel JWT Authentication Tutorial Example

Laravel JWT Authentication Tutorial Example From Scratch. We will use Laravel 5.6 For this example. API token authentication is an important security aspect of web and mobile application. Setting up API Token-based Authentication in Laravel 5.6 Tutorial Example From Scratch.