Book Image

Laravel Application Development Blueprints

By : Arda Kılıçdağı, Halil İbrahim Yılmaz
Book Image

Laravel Application Development Blueprints

By: Arda Kılıçdağı, Halil İbrahim Yılmaz

Overview of this book

<p>Laravel is a clean and classy framework for PHP web development. It helps you to create wonderful applications using simple, expressive syntax. Development should be a creative and enjoyable experience, not something that is painful, and Laravel makes it enjoyable for the users. Laravel's directory structure is designed to be familiar to users of other popular PHP frameworks. Web applications of any shape or size can easily be created using this structure similar to the way that they would be created in other frameworks. With the recently released 4th Version, Laravel became even better in numerous ways. Within this book, we will help you learn about both the old and new features of Laravel while developing various applications.</p> <p>Laravel Application Development Blueprints covers how to develop 10 different applications step-by-step using Laravel 4. You will also learn about both basic and advanced usage of Laravel’s built-in methods, which will come in handy for your project. Also, you will learn how to extend the current libraries with the built-in methods and include third-party libraries.</p> <p>This book looks at the Laravel PHP framework and breaks down the ingrained prejudice that coding with PHP causes due to spaghetti code. It will take you through a number of clear, practical applications that will help you to take advantage of the Laravel PHP framework and PHP OOP programming whilst avoiding spaghetti code.</p> <p>You'll also learn about creating secure web applications using different methods such as file uploading and processing, making RESTful AJAX requests, and form processing. If you want to take advantage of the Laravel PHP framework's validate, file processing, and RESTful controllers in various types of projects, then this is the book for you.<br />Everything you need to know to code fast and secure applications with the Laravel PHP framework will be discussed in this book.</p>
Table of Contents (17 chapters)
Laravel Application Development Blueprints
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 9. Building a RESTful API – The Movies and Actors Databases

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