74 lines
2.4 KiB
PHP
74 lines
2.4 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
|
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
|
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
use Spatie\MediaLibrary\HasMedia;
|
|
use Spatie\MediaLibrary\InteractsWithMedia;
|
|
use Swindon\FilamentHashids\Traits\HasHashid;
|
|
|
|
class Company extends Model implements HasMedia
|
|
{
|
|
use HasFactory, HasHashid, InteractsWithMedia, SoftDeletes;
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
public static function dataChangeEntryLabels(): array
|
|
{
|
|
return [
|
|
'name' => 'Nama',
|
|
'email' => 'Alamat Surel',
|
|
'phone_number' => 'Nomor Telepon',
|
|
'address' => 'Alamat',
|
|
'director_name' => 'Nama Direktur',
|
|
'director_nik' => 'NIK Direktur',
|
|
'director_nik_docs' => 'Dokumen NIK Direktur',
|
|
'deed_incorporation' => 'Akta Pendirian',
|
|
'deed_incorporation_docs' => 'Dokumen Akta Pendirian',
|
|
'trade_license' => 'SIUP / NIB',
|
|
'trade_license_docs' => 'Dokumen SIUP / NIB',
|
|
'tax_id_number' => 'NPWP',
|
|
'tax_id_number_docs' => 'Dokumen NPWP',
|
|
'taxable_enterprise' => 'PKP',
|
|
'taxable_enterprise_docs' => 'Dokumen PKP',
|
|
'annual_tax_return' => 'SPT Tahunan',
|
|
'annual_tax_return_docs' => 'Dokumen SPT Tahunan',
|
|
'domicile_certificate' => 'Suket Domisili',
|
|
'domicile_certificate_docs' => 'Dokumen Suket Domisili',
|
|
'profile' => 'Profil Perusahaan',
|
|
'profile_docs' => 'Dokumen Profil Perusahaan',
|
|
];
|
|
}
|
|
|
|
public function dataChangeRequests(): MorphMany
|
|
{
|
|
return $this->morphMany(DataChangeRequest::class, 'entity');
|
|
}
|
|
|
|
public function journalists(): HasManyThrough
|
|
{
|
|
return $this->hasManyThrough(Journalist::class, PartnerMedia::class);
|
|
}
|
|
|
|
public function partnerMedia(): HasOne
|
|
{
|
|
return $this->hasOne(PartnerMedia::class);
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
public function verificationRequest(): HasOne
|
|
{
|
|
return $this->hasOne(VerificationRequest::class);
|
|
}
|
|
}
|