Explorar o código

live changes, added diferent hours in seeds

Serge %!s(int64=5) %!d(string=hai) anos
pai
achega
7caff67d95
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      database/factories/LocationFactory.php

+ 3 - 1
database/factories/LocationFactory.php

@@ -16,11 +16,13 @@ $factory->define(Location::class, function (Faker $faker) {
         $lngArray[] = $lng;
         $lng += 0.00715;
     }
+    $time = Carbon::now()->subDays(rand(1, 10))->subHours(rand(8, -8));
 
     return [
         'lat' => array_random($latArray),
         'lng' => array_random($lngArray),
-        'created_at' => Carbon::now()->subDays(rand(1, 10)),
+	'created_at' => $time,
+	'updated_at' => $time,
         'user_id' => null,//
     ];
 });