syed_eer
how can I customise the section's width?
Placeholder::make('course_selected')->label('Course Selected')->disabled()->content(
fn ($get) => $get('course_selected')
)->extraAttributes(['class' => 'text-blue-500'])
and Section::make('Student Summary')
->columnSpan(1)
->schema([
])->extraAttributes(['class' => 'text-blue-500']),
tried both ways, its not working.9 replies
Text or TextInput fiedl can be dynamically populated?
wow, this also works,
Select::make('student_id')
->label('Student Name')
->options(Student::all()->pluck('name', 'id')->toArray())->reactive()->live()
->afterStateUpdated(function ($state, $set) {
if ($state) {
$set('fee_plan_name', Student::find($state)->fee_plan->name);
} else {
$set('fee_plan_name', '');
}
})->searchable(),
TextInput::make('fee_plan_name')->disabled(),
46 replies
Text or TextInput fiedl can be dynamically populated?
with your kind help, I think somehow I got this working, could you please check this code.
Select::make('student_id')
->label('Student Name')
->options(Student::all()->pluck('name', 'id')->toArray())->reactive()->live()
->afterStateUpdated(function ($state, $set) {
if ($state) {
$fPId = Student::find($state)->fee_plan_id;
$FPidMatch = FeePlan::where('id', $fPId)->get();
$stdFPname = $FPidMatch->pluck('name');
$set('fee_plan_name', $stdFPname);
} else {
$set('fee_plan_name', '');
}
})->searchable(),
TextInput::make('fee_plan_name')->disabled(),
46 replies
Text or TextInput fiedl can be dynamically populated?
yeah, that's right, I just need whenever the student name gets selected from the dropdown, the fee_plan_name changes accordingly (based on the fee_plan selected by this particular student in the students table).
46 replies