神刀安全网

Test Driven API Development using Laravel, Dingo and JWT with Documentation

Test Driven API Development using Laravel, Dingo and JWT with Documentation

As the complexity of API’s increase, improving the ways we create them becomes a necessity.

Let’s take a journey exploring an efficient way of building well-tested API’s that are easy to develop and maintain by wiring up several different open-source packages.

In this tutorial, we will build a very simple API for fruits that lists all the fruits, shows one fruit, creates a fruit, and finally deletes a fruit.

The API will allow anyone to list and show fruits but we will use JWT Authentication to protect creating and deleting operations so only the registered users can use them.

Before we start, let’s look at everything we will cover:

  • Landmark 1 : Prepare our TDD environment and creating our first test.
  • Landmark 2: Installing and configuring Dingo API package.
  • Landmark 3: What are Transformers, why the need for them and how to use thephpleague / fractal as our transformation layer.
  • Landmark 4: Introduction about JWT and how to use tymondesigns / jwt-auth for our token based authentication.
  • Landmark 5: How to use laravel-apidoc-generator to generate nice documentation for our API.

So, pack your bags and let’s dive into our journey!

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » Test Driven API Development using Laravel, Dingo and JWT with Documentation

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址