Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Zero to API With Lumen

Zero to API With Lumen

Ever wanted to create an API but weren't sure how to get started? Create APIs quickly with the Lumen PHP micro-framework.

Amanda Folson

July 28, 2016
Tweet

More Decks by Amanda Folson

Other Decks in Programming

Transcript

  1. Who Am I? ▸ Amanda Folson ▸ Developer Advocate at

    GitLab ▸ Professional Conference Attendee ▸ OSS ~10 years ◦ Many years of APIs
  2. REST APIs ▸ Representational State Transfer ▸ Can return XML,

    JSON, YAML, Markdown ▸ RAPIDLY gaining adoption over SOAP/XML-RPC ◦ No need to know order of parameters
  3. HTTP-based APIs ▸ Often HTTP-based ◦ Many things natively speak

    HTTP ▸ Stateless ◦ No sessions! ◦ HATEOAS
  4. Differences Between Laravel and Lumen in Artisan Lumen’s `artisan`: ▸

    No `serve` command ▸ No `key:generate` ▸ No `tinker` ▸ No `env` ▸ No `down` ▸ No `vendor:publish`
  5. Differences in Artisan’s Make Command Lumen’s `make`: ▸ ONLY has

    `make:migration` ▸ No `make:model` ▸ No `make:controller` ▸ No `make:auth` + scaffolding ▸ Many more since Lumen is slimmed down
  6. Resources ▸ /resource is a gateway to an area of

    an application ◦ In this case, we hit /pokemon ◦ We can get a single Pokémon or a collection of them
  7. Beyond This Talk ▸ HATEOAS and Hypermedia ▸ Rate limiting

    ▸ Running APIs at scale ▸ Events ▸ Queues ▸ Caching ▸ Encryption ▸ Logging ▸ Deploying
  8. /resources ▸ Lumen and Laravel docs ◦ https://lumen.laravel.com/docs/ ▸ Paul

    Redmond’s Book ◦ https://www.apress.com/9781484221860 ▸ Build APIs You Won’t Hate by Phil Sturgeon ▸ RESTful Web APIs by Leonard Richardson, Mike Amundsen, and Sam Ruby ▸ Undisturbed REST by Mike Stowe ▸ Me!