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
yukebrillianthOP10mo ago
can anyone help me?
kool
kool9mo ago
help?
Tieme
Tieme9mo ago
Can you share de migration of 'status' ? What kind of field is it in DB?
Want results from more Discord servers?
Add your server