ldc-gen-game-web/database/seeders/Development/PrizeSeeder.php

45 lines
1.2 KiB
PHP
Raw Normal View History

2022-02-24 14:12:47 +01:00
<?php
2023-11-30 11:10:02 +01:00
namespace Database\Seeders\Development;
2022-02-24 14:12:47 +01:00
use App\Models\Prize;
use Illuminate\Database\Seeder;
2023-11-30 11:10:02 +01:00
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Schema;
2022-02-24 14:12:47 +01:00
class PrizeSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
2023-11-30 11:10:02 +01:00
Schema::disableForeignKeyConstraints();
DB::table('prizes')->truncate();
Schema::enableForeignKeyConstraints();
File::deleteDirectory(\storage_path('app/public/modelfiles/prizes'));
2022-08-11 10:03:16 +02:00
$prize = new Prize();
$prize->label_one = 'Lot 1';
$prize->label_many = 'Lots 1';
$prize->arg_title = 'Titre Lot 1';
2022-08-11 07:33:30 +00:00
$prize->arg_subtitle = 'Sous-titre Lot 1';
2022-08-11 10:03:16 +02:00
$prize->arg_content = 'Argumentaire du lot 1';
$prize->quantity = 1;
2022-02-24 14:12:47 +01:00
$prize->save();
2022-08-11 10:03:16 +02:00
$prize = new Prize();
$prize->label_one = 'Lot 2';
$prize->label_many = 'Lots 2';
$prize->arg_title = 'Titre Lot 2';
2022-08-11 07:33:30 +00:00
$prize->arg_subtitle = 'Sous-titre Lot 2';
2022-08-11 10:03:16 +02:00
$prize->arg_content = 'Argumentaire du lot 2';
$prize->quantity = 2;
2022-02-24 14:12:47 +01:00
$prize->save();
}
}