Files
basicdata/app/Models/Branch.php
Sholahuddin Al Ayubi fec8dc083c feat(Basicdata): Update 'is_dalam_kota' column and add new branches
- Update 'is_dalam_kota' to true for existing branches based on suffix code
- Set 'is_dalam_kota' to false for branches not in the list
- Add new branches (ID0012005 - KORPORASI, ID0010172 - AMBON TUAL MALUKU)
- Seeder is idempotent and can be rerun safely

run this command:
php artisan module:seed Basicdata --class="UpdateBranchesIsDalamKotaSeeder"

php artisan module:seed --class="Modules\\Basicdata\\Database\\Seeders\\UpdateBranchesIsDalamKotaSeeder"
2025-12-08 17:19:12 +07:00

44 lines
1007 B
PHP

<?php
namespace Modules\Basicdata\Models;
class Branch extends Base
{
protected $table = 'branches';
protected $fillable = [
'code',
'name',
'is_dalam_kota',
'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');
}
}