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

Nick Halstead's Blog: How to make AuctionAd$ dynamic with PHP

Richard Thomas' Blog: Improving PHP Sessions

David Coallier's Blog: PEAR::DB is Deprecated, Got It?

Hasin Hayder's Blog: Working with models in orchid

Zend Developer Zone: Build an Enterprise-Grade PHP Stack with Zend Server 5.0 and Oracle 11g


Community Events





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


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

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