Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get a lot of Time Entries
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\TimeEntry;
use Faker\Generator as Faker;
$factory->define(TimeEntry::class, function (Faker $faker) {
$username = [
$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