mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/unity.git
synced 2026-08-19 12:24:01 +00:00
5cb7596c6c
Repair Service
40 lines
1.1 KiB
PHP
40 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders\RepairService;
|
|
|
|
use App\Models\ContractTemplate;
|
|
|
|
use Illuminate\Database\Seeder;
|
|
use Illuminate\Support\Str;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Carbon\Carbon;
|
|
|
|
class RepairServiceContractsTableSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function run()
|
|
{
|
|
$contract_template = ContractTemplate::find(2);
|
|
|
|
DB::table('contracts')->insert([
|
|
[
|
|
'id' => 2,
|
|
'user_id' => $contract_template->user_id,
|
|
'contract_template_id' => $contract_template->id,
|
|
'name' => $contract_template->name,
|
|
'in_time_contract_template' => json_encode($contract_template),
|
|
'status' => 1,
|
|
'completed_at' => null,
|
|
'failed_at' => null,
|
|
'start_at' => Carbon::now(),
|
|
'end_at' => Carbon::now()->addDays($contract_template->complete_day_range),
|
|
'created_at' => date('Y-m-d H:i:s'),
|
|
'updated_at' => date('Y-m-d H:i:s')
|
|
]
|
|
]);
|
|
}
|
|
} |