Skip to content

Instantly share code, notes, and snippets.

@nick-f
Created December 1, 2016 05:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nick-f/122b1ff6a88034a68bdce26434cb3c1e to your computer and use it in GitHub Desktop.
Save nick-f/122b1ff6a88034a68bdce26434cb3c1e to your computer and use it in GitHub Desktop.
Generate random data for Laravel Spark metrics to show off the graphs
Route::get('/metricsdummy', function() {
for ($i = 0; $i < 100; $i++) {
DB::table('performance_indicators')->insert([
'monthly_recurring_revenue' => mt_rand(1000, 2000),
'yearly_recurring_revenue' => mt_rand(50000, 60000),
'daily_volume' => mt_rand(100, 300),
'new_users' => mt_rand(50, 100),
'created_at' => Carbon\Carbon::now()->subDays($i),
'updated_at' => Carbon\Carbon::now()->subDays($i),
]);
}
return 'Done!';
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment