Wednesday, December 6, 2023
HomeVideo EditingThe right way to Construct a REST API With Laravel

The right way to Construct a REST API With Laravel


Laravel permits you to simply and shortly construct RESTful APIs. This might be the back-end to a front-end net app, an information supply for a cell app, or a service for different apps or APIs.

There are a variety of transferring items to coding a RESTful API, however Laravel makes it so much simpler. On this free course you will be taught every part you want to know to construct RESTful APIs with Laravel.


What You will Study

  • outline knowledge fashions and seeding database check knowledge
  • deal with primary GET requests 
  • rework knowledge from the database right into a constant and traditional JSON format
  • create versatile and reusable filter syntax for customers to question and filter knowledge
  • deal with and validate POST, PUT, and PATCH requests
  • implement bulk inserts for finish customers to shortly insert a number of entities with a single request 
  • shield your API endpoints with Laravel Sanctum to authenticate and authorize requests

Who’s This Free Course For?

  • full newcomers who need to be net builders
  • skilled builders who need to discover superior matters
  • programming fans who take pleasure in studying one thing thrilling

Observe Alongside, Study by Doing

I encourage you to follow together with this course, and you may find out about all an important options of Vue.js

To assist, the Construct a Relaxation API with Laravel Github repository accommodates the supply code for every lesson and the finished pattern challenge that was constructed all through the course. 

1. Introduction

Watch video lesson [0:00:00] ↗

This course will train you methods to construct a Relaxation API with Laravel. On this introductory lesson, you will check out the scope of the course. 

2. Getting Began

Creating the Venture

Watch video lesson [0:01:38] ↗

On this lesson, you will go over the belongings you’ll must comply with alongside on this course. Observe alongside to arrange your dev setting and create your challenge.

Here’s a fast tutorial on methods to arrange your Laravel setting for Home windows:

Designing and Seeding the Database

Watch video lesson [0:7:36] ↗

On this lesson, you will create the migrations, factories, and seed knowledge for our database.

3. Offering Knowledge

Versioning and Defining Routes

Watch video lesson [0:19:22] ↗

Good net APIs are versioned, so you want to implement some sort of versioning. You will additionally arrange the routes for the primary model of the API.

Remodeling Database Knowledge Into JSON

Watch video lesson [0:26:17] ↗

RESTful APIs sometimes present knowledge in JSON format utilizing JSON naming conventions. On this lesson, you will use Useful resource courses to rework our knowledge into typical JSON.

Filtering Knowledge

Watch video lesson [0:35:48] ↗

It’s good to present the flexibility for shoppers to filter outcomes. You will implement a buyer filter on this lesson.

Filtering Extra Knowledge

Watch video lesson [0:49:47] ↗

On this lesson, you generalize our filter performance as a way to reuse it for any useful resource.

Together with Associated Knowledge

Watch video lesson [0:58:49] ↗

It typically is smart to incorporate associated knowledge in API’s outcomes, nevertheless it must be a function that shoppers decide in to. You will implement that on this lesson.

4. Manipulating Knowledge

Creating Sources With POST Requests

Watch video lesson [1:05:37] ↗

POST requests are for creating sources. You will deal with POST requests to create buyer sources on this lesson.

See the Laravel documentation on Constructed-in Validation Guidelines for extra info.

Updating With PUT and PATCH

Watch video lesson [1:14:48] ↗

We replace knowledge utilizing PUT and PATCH requests, and you may learn to deal with each forms of requests on this lesson.

Implementing Bulk Insert

Watch video lesson [1:22:51] ↗

Some sources should be inserted in bulk. You will learn to implement that on this lesson.

5. Authentication

Defending Routes With Sanctum

Watch video lesson [1:33:41] ↗

Laravel 7 launched Sanctum, a token authentication scheme for APIs and SPA. It is superior, and you may use it to create tokens on this lesson.

Study extra about Laravel Sanctum within the official docs.

Authorizing Requests With Token Skills

Watch video lesson [1:41:29] ↗

Sanctum permits us to assign talents to tokens, and it is easy to authorize requests. Nonetheless, there is a caveat that you will find out about on this lesson.

Conclusion

Watch video lesson [1:48:10] ↗

Laravel has the instruments we have to construct usable and scalable purposes—together with RESTful APIs. In actual fact, Laravel does a variety of the arduous stuff for us, making it a way more pleasant approach to construct software program.

Study extra within the official Laravel Documentation or The Laravel Group Portal.

PHP Tutorial for Newcomers – Full Course | OVER 7 HOURS!

Study the basics of PHP and object-oriented programming on this free 7-hour PHP tutorial. Jeremy McPeak will allow you to be taught PHP and use it to put in writing net apps. 


RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments