Designing and developing a successful RESTful API is mostly very difficult. There are a lot of aspects to designing and writing a successful RESTful API; for example, securing and limiting the API. In this chapter, we’ll focus on the basics of REST with coding a simple Movies and Actors API with Laravel. We’ll make some JSON endpoints behind a basic authentication system, and will also learn a few Laravel 4 tricks. We’ll cover the following topics in this chapter:

Creating and migrating the users database

Configuring the users model

Adding sample users

Creating and migrating the movies database

Creating a movie model

Adding sample movies

Creating and migrating the actors database

Creating an actor model

Assigning actors to movies

Understanding the authentication mechanism

Querying the API