Skip to content

Instantly share code, notes, and snippets.

@amitavroy
Created August 15, 2020 06:09
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amitavroy/58e8649e40e70ad0e332a8d1eac5c4c7 to your computer and use it in GitHub Desktop.
Save amitavroy/58e8649e40e70ad0e332a8d1eac5c4c7 to your computer and use it in GitHub Desktop.
Get a lot of Time Entries
<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\TimeEntry;
use Faker\Generator as Faker;
$factory->define(TimeEntry::class, function (Faker $faker) {
$username = [
'Amitav',
'Jhon',
'Michael',
'James',
'Robert',
'William',
'David',
'Thomas',
'Christopher',
'Matthew',
'Donald',
'Andrew',
'Edward',
'Jason',
];
$project = ['Youtube', 'Google Play', 'Vuejs', 'Twitter', 'MySQL Package', 'JSAlbum', 'Website'];
return [
'username' => $faker->randomElement($username),
'project' => $faker->randomElement($project),
'date' => $faker->dateTimeBetween('-6 months', 'now'),
'time' => rand(1, 8),
];
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment