You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a model that have foreign id. I was able to create a model instance with foreign id value By using livewire-select. But when editing a model instance, my selected foreign model class can't displayed at form edit
here is my model class:
class MasterBarang extends Model
{
use HasFactory;
use UserRelationship;
protected $table = 'master_barang';
protected $fillable = ['mtgkey', 'kode_perkiraan', 'nama_perkiraan', 'level', 'kode_khusus', 'tipe', 'satuan', 'created_user_id', 'updated_user_id'];
}
class SaldoAwal extends Model
{
use HasFactory;
protected $table = 'saldo_awal';
protected $fillable = [
'unit_key',
'nomor_bapnb',
'nomor_spk',
'tanggal',
'kode_gudang',
'kode_transaksi',
'tanggal_verifikasi',
'created_user_id',
'updated_user_id'
];
public function items()
{
return $this->hasMany(SaldoAwalItem::class);
}
}
class SaldoAwalItem extends Model
{
use HasFactory;
protected $table = 'saldo_awal_item';
protected $fillable = [
'saldo_awal_id',
'unit_key',
'nomor_bapnb',
'master_barang_id',
'jumlah',
'harga',
'total_harga',
'id_satuan',
'merek',
'verified',
'created_user_id',
'updated_user_id'
];
public function master_barang()
{
return $this->belongsTo(MasterBarang::class);
}
}
hi all,
I have a model that have foreign id. I was able to create a model instance with foreign id value By using livewire-select. But when editing a model instance, my selected foreign model class can't displayed at
form edit
here is my model class:
here my livewire-select class
here is my livewire class
and here is my blade template
Any suggestion ? thanks
The text was updated successfully, but these errors were encountered: