From 4b668a83efd0672387fc858122570b3cc9adb5f9 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Sun, 22 Nov 2015 20:05:39 +0000 Subject: [PATCH] Use the random_int function --- app/Console/Commands/DemoMetricPointSeederCommand.php | 2 +- app/Console/Commands/DemoSeederCommand.php | 2 +- database/factories/ModelFactory.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Console/Commands/DemoMetricPointSeederCommand.php b/app/Console/Commands/DemoMetricPointSeederCommand.php index d20ea27e..7c731b6c 100644 --- a/app/Console/Commands/DemoMetricPointSeederCommand.php +++ b/app/Console/Commands/DemoMetricPointSeederCommand.php @@ -72,7 +72,7 @@ class DemoMetricPointSeederCommand extends Command MetricPoint::create([ 'metric_id' => 1, - 'value' => rand(1, 10), + 'value' => random_int(1, 10), 'created_at' => $metricTime, 'updated_at' => $metricTime, ]); diff --git a/app/Console/Commands/DemoSeederCommand.php b/app/Console/Commands/DemoSeederCommand.php index 5b5a2cba..e68e594f 100644 --- a/app/Console/Commands/DemoSeederCommand.php +++ b/app/Console/Commands/DemoSeederCommand.php @@ -210,7 +210,7 @@ class DemoSeederCommand extends Command MetricPoint::create([ 'metric_id' => 1, - 'value' => rand(1, 10), + 'value' => random_int(1, 10), 'created_at' => $metricTime, 'updated_at' => $metricTime, ]); diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php index 95c0359f..ae81fd28 100644 --- a/database/factories/ModelFactory.php +++ b/database/factories/ModelFactory.php @@ -62,7 +62,7 @@ $factory->define('CachetHQ\Cachet\Models\Metric', function ($faker) { $factory->define('CachetHQ\Cachet\Models\MetricPoint', function ($faker) { return [ 'metric_id' => 1, - 'value' => rand(1, 100), + 'value' => random_int(1, 100), ]; });