41 lines
828 B
PHP
Executable File
41 lines
828 B
PHP
Executable File
<?php
|
|
|
|
use Illuminate\Database\Seeder;
|
|
use Illuminate\Support\Facades\DB;
|
|
use App\Libraries\UuidHelper;
|
|
|
|
class PhotoSliderTableSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function run()
|
|
{
|
|
|
|
DB::table('photo_slider')->truncate();
|
|
|
|
|
|
for ($i=1; $i <= 20; $i++) {
|
|
$uuid = new UuidHelper;
|
|
$uuid = $uuid->generate_uuid1();
|
|
|
|
$data[] = array(
|
|
'photoslider_uuid' => $uuid,
|
|
'promotion_id' => 0,
|
|
'title' => 'sample title',
|
|
'description' => 'sample description',
|
|
'image' => '',
|
|
'date_start' => date('Y-m-d H:i:s'),
|
|
'date_end' => date('Y-m-d H:i:s',strtotime("+3 days")),
|
|
'created_at' => date('Y-m-d H:i:s')
|
|
);
|
|
|
|
|
|
}
|
|
|
|
DB::table('photo_slider')->insert($data);
|
|
}
|
|
}
|