background preloader

Tutorials & Guides

Facebook Twitter

Laravel 4: A Start at a RESTful API (Updated) RESTful API's are hard! There are a lot of aspects to designing and writing a successful one. For instance, some of the topics that you may find yourself handling include authentication, hypermedia/HATEOS, versioning, rate limits, and content negotiation. Rather than tackling all of these concepts, however, let's instead focus on the basics of REST. We'll make some JSON endpoints behind a basic authentication system, and learn a few Laravel 4 tricks in the process. Let's build an API for a simple Read-It-Later app. Create a new install of Laravel 4. We're going to first create an encryption key for secure password hashing. Alternatively, you can simple edit your app/config/app.php encryption key: Once you have a working install of Laravel 4, we can get started with the fun. This will only require two database tables: Users, including a username and passwordURLs, including a url and description We'll use Laravel's migrations to create and populate the database.

Let's test this out. Cool! Building RESTful API in Laravel - start here - Maxoffsky | Over the past few weeks I’ve been very busy learning basics of Backbone – an MV* framework for Javascript because it simplifies creation of one page applications (great for mobile devices!). In just two weeks I built a working mobile app for the company I’m working for, and soon it will be released to Android and Apple app stores. Of course there is great complexity behind this all but what I have noticed is that having a bad API for your application can slow down building mobile apps and impact the ecosystem of your product.

My goal for this month is to learn building RESTful APIs from scratch in Laravel – the framework that I use for all of my new web applications. If you don’t know what RESTful means, check out this wikipedia article : What is the purpose of RESTful APIs? Check out the slides below : (from Or watch this video on vimeo : Teach a Dog to REST from Apigee on Vimeo. In Routes.php I just add :