select field value not populating on edit when using realtion modifyQueryUsing

Select::make('voucher_id')
->label('Voucher Code')
->relationship(name: 'voucher', titleAttribute: 'code', modifyQueryUsing: fn (Builder $query) => $query->with('package')->where('status', 'fresh'))
->prefixIcon('heroicon-o-ticket')
->disabled(Voucher::where('status', 'fresh')->get()->isEmpty())
->required(),
Select::make('voucher_id')
->label('Voucher Code')
->relationship(name: 'voucher', titleAttribute: 'code', modifyQueryUsing: fn (Builder $query) => $query->with('package')->where('status', 'fresh'))
->prefixIcon('heroicon-o-ticket')
->disabled(Voucher::where('status', 'fresh')->get()->isEmpty())
->required(),
No description
3 Replies
yukebrillianth
yukebrillianth4mo ago
can anyone help me?
kool
kool3mo ago
help?
Tieme
Tieme3mo ago
Can you share de migration of 'status' ? What kind of field is it in DB?