38 lines
719 B
PHP
38 lines
719 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Seeder;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Faker\Factory as Faker;
|
|
|
|
class MobileAnalyticsTableSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function run()
|
|
{
|
|
|
|
DB::table('mobile_analytics')->truncate();
|
|
|
|
|
|
for ($i=1; $i <= 20; $i++) {
|
|
$faker = Faker::create();
|
|
$unixTimestamp = '1461067200';
|
|
|
|
$lastName = $faker->lastName;
|
|
$data[] = array(
|
|
'date' => $faker->date('Y-m-d', $unixTimestamp),
|
|
'active' => rand(100,500),
|
|
'inactive' => rand(100,500),
|
|
'locked' => rand(1,100),
|
|
);
|
|
|
|
|
|
}
|
|
|
|
DB::table('mobile_analytics')->insert($data);
|
|
}
|
|
}
|