Skip to content

codereviewvideos/api.symfony-3.crud

Repository files navigation

Simple CRUD API with Symfony 3 and FOSRESTBundle

This is an example of a very basic CRUD API using Symfony 3 and FOSRESTBundle.

This is the API made during the second set of videos of this course.

The aim of this course is to show how you can use Symfony 3 (along with some other bundles) to quickly make a working RESTful API to use as the back end for any modern front-end framework - such as Angular, React, Ember, or any of the mobile app frameworks like Ionic, or desktop frameworks such as Electron.

If you haven't already seen it, check out the Twig version of this API, where everything is a little more static, but also much more visual and easy to follow along if new to Symfony 3.

The code you see here is providing the same functionality is in the Twig version, but you will need a REST client such as Postman to interact properly with the API. The next step is to build a proper front end using Angular, React, or similar.

PHP 7

This app was written using PHP 7. There may be backwards compatability issues, primarily around type hinting.

More Real World Version

This is an introduction to quickly building API's with Symfony 3.

In truth, beyond a simple implementation such as this, API's can become quite complex.

If you understand the basics and want to make a more robust system - including testing with Behat, and PHPSpec, then I would recommend you check out my Symfony 3 REST Tutorial instead / as well.