File size: 766 Bytes
b2dcf0f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bdec7a7
 
 
b2dcf0f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php

namespace App\Domain\Files;

use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\DB;

class FileLinkRepository
{
    public const TARGET_COLUMNS = [
        'application_id',
        'membership_id',
        'product_request_id',
        'contract_id',
        'support_case_id',
        'care_enrollment_id',
        'care_person_id',
        'care_claim_id',
        'care_beneficiary_id',
        'real_estate_partner_id',
        'marketplace_vendor_id',
    ];

    public function create(array $attributes): string
    {
        $now = Carbon::now();

        DB::table('file_links')->insert(array_merge($attributes, [
            'created_at' => $now,
            'updated_at' => $now,
        ]));

        return $attributes['id'];
    }
}