Skip to content

Instantly share code, notes, and snippets.

@tilhom
Created June 30, 2018 12:37
Show Gist options
  • Save tilhom/5e5c7d5d1ec29edf698b3cc35236183a to your computer and use it in GitHub Desktop.
Save tilhom/5e5c7d5d1ec29edf698b3cc35236183a to your computer and use it in GitHub Desktop.
factory for People (for: Using Laravel 5.5 Resources to create your own {JSON:API} formatted API)
<?php
use Faker\Generator as Faker;
$factory->define(App\People::class, function (Faker $faker) {
return [
'first_name' => $faker->firstName,
'last_name' => $faker->lastName,
'twitter' => '@'.$faker->userName
];
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment