- Menambahkan kolom 'custom_fields' pada tabel 'jenis_legalitas_jaminan'. - Memperbarui model untuk mengizinkan pengisian 'custom_fields' sebagai array. - Memperbarui request untuk validasi 'custom_fields' sebagai array. - Memperbarui controller untuk mengambil dan mengirimkan custom fields saat membuat dan mengedit jenis legalitas jaminan.
21 lines
528 B
PHP
21 lines
528 B
PHP
<?php
|
|
|
|
namespace Modules\Lpj\Models;
|
|
|
|
use Modules\Lpj\Database\Factories\JenisLegalitasJaminanFactory;
|
|
|
|
class JenisLegalitasJaminan extends Base
|
|
{
|
|
protected $table = 'jenis_legalitas_jaminan';
|
|
protected $fillable = ['code', 'name','slug','custom_field','custom_field_type','custom_fields'];
|
|
|
|
protected $casts = [
|
|
'custom_fields' => 'array',
|
|
];
|
|
|
|
public function customFields()
|
|
{
|
|
return $this->hasMany(CustomField::class);
|
|
}
|
|
}
|