- Menambahkan kolom baru pada tabel `branches` melalui migrasi: - `address` - `mnemonic` - `customer_company` - `customer_mnemonic` - `company_group` - `curr_no` - `co_code` - `l_vendor_atm` - `l_vendor_cpc` - Memperbarui model `Branch` agar mendukung kolom baru di properti `fillable`. - Menambahkan dukungan pencarian berdasarkan kolom `address` pada: - `BranchExport.php` (untuk ekspor data) - `BranchController.php` (untuk API pencarian data cabang) - Memperbarui tampilan daftar cabang (`branch/index.blade.php`) untuk menampilkan kolom `address`. - Memperbarui format data ekspor cabang dengan menambahkan kolom `address`. - Memperbaiki pengaturan format kolom tanggal pada data ekspor. Signed-off-by: Daeng Deni Mardaeni <ddeni05@gmail.com>
43 lines
978 B
PHP
43 lines
978 B
PHP
<?php
|
|
|
|
namespace Modules\Basicdata\Models;
|
|
|
|
class Branch extends Base
|
|
{
|
|
protected $table = 'branches';
|
|
protected $fillable = [
|
|
'code',
|
|
'name',
|
|
'address',
|
|
'mnemonic',
|
|
'customer_company',
|
|
'customer_mnemonic',
|
|
'company_group',
|
|
'curr_no',
|
|
'co_code',
|
|
'l_vendor_atm',
|
|
'l_vendor_cpc',
|
|
'status',
|
|
'authorized_at',
|
|
'authorized_status',
|
|
'authorized_by',
|
|
'parent_id'
|
|
];
|
|
|
|
/**
|
|
* Get the parent branch of this branch
|
|
*/
|
|
public function parent()
|
|
{
|
|
return $this->belongsTo(Branch::class, 'parent_id');
|
|
}
|
|
|
|
/**
|
|
* Get the child branches of this branch
|
|
*/
|
|
public function children()
|
|
{
|
|
return $this->hasMany(Branch::class, 'parent_id');
|
|
}
|
|
}
|