News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Phil Sturgeon:
Build API's That You Wont Hate Part 1 - Useful Database Seeding
November 11, 2013 @ 09:19:33

Phil Sturgeon has posted the first part of a series he calls "Build API's That You Won't Hate", a follow up to one of his previous posts about building good APIs in your application.

A little while back I produced an article called Building a Decent API which was mostly a tongue-in-cheek list of things that I'd come across in other APIs that pissed me off, or that I had done myself and used my super-power of hindsight combined with sarcasm to make a set of rules for you to live by when building APIs. The combination of cheek and naughty words made that "eat your greens" article go down a lot more smoothly, but it certainly lacked a little substance but I always wanted to turn that into a much more in depth of blog posts.

In this first part of the series he covers one main topic - generating "good" data for you to use in your development environment. As he points out, using production data in development databases dangerous for several reasons. He suggests the Faker library to do what's called "database seeding" and generating fake, but accurately formatted, data to use for testing. He includes some sample code showing how to use the PHP tool to generate as set of seed user data. He also shows how to create a DatabaseSeeder class for Laravel and integrate it with the tool.

0 comments voice your opinion now!
api development database seeding faker laravel

Link: http://philsturgeon.co.uk/blog/2013/11/build-apis-part-1-useful-database-seeding

blog comments powered by Disqus

Similar Posts

Tim Koschuetzki's Blog: How to put Combined Fields Into CakePHP's Model->generateList()

NetTuts.com: How to Generate a Complete Excel Spreadsheet From MySQL

KillerPHP.com: What is Source Control and Why Should I Use It?

Community News: O'Reilly Offers PHP/SQL Certificate Series

NETTUTS.com: Why you Should be using PHP's PDO for Database Access


Community Events





Don't see your event here?
Let us know!


symfony language security community podcast package introduction opinion composer update application interview install series framework version laravel library voicesoftheelephpant release

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework