mugiwara
mugiwara
FFilament
Created by mugiwara on 9/25/2023 in #❓┊help
get form data from action
thanks, that solved my problem
5 replies
FFilament
Created by mugiwara on 9/1/2023 in #❓┊help
datepicker state update
thank again
17 replies
FFilament
Created by mugiwara on 9/1/2023 in #❓┊help
datepicker state update
after that when i pick a date in plan started it showed me expire date based on selected option from plan term
17 replies
FFilament
Created by mugiwara on 9/1/2023 in #❓┊help
datepicker state update
so i did this
` $set('plan_expires', $exp->format('Y-m-d'));
` $set('plan_expires', $exp->format('Y-m-d'));
`
17 replies
FFilament
Created by mugiwara on 9/1/2023 in #❓┊help
datepicker state update
when i look again the logs, i think about may the reason date format after the adding year or month
17 replies
FFilament
Created by mugiwara on 9/1/2023 in #❓┊help
datepicker state update
i solved my problem
17 replies
FFilament
Created by mugiwara on 9/1/2023 in #❓┊help
datepicker state update
this is also give a correct log
17 replies
FFilament
Created by mugiwara on 9/1/2023 in #❓┊help
datepicker state update
i also try like this for is set method set to the plan_expires
` Log::debug('exp date', [$get('plan_expires')]);
` Log::debug('exp date', [$get('plan_expires')]);
`
17 replies
FFilament
Created by mugiwara on 9/1/2023 in #❓┊help
datepicker state update
but i cant see the plan expires date in datepicker
17 replies
FFilament
Created by mugiwara on 9/1/2023 in #❓┊help
datepicker state update
and the log
[2023-09-03 12:30:33] local.DEBUG: state ["2023-09-22"]
[2023-09-03 12:30:33] local.DEBUG: exp date ["2023-10-22 00:00:00"]
[2023-09-03 12:30:33] local.DEBUG: state ["2023-09-22"]
[2023-09-03 12:30:33] local.DEBUG: exp date ["2023-10-22 00:00:00"]
`
17 replies
FFilament
Created by mugiwara on 9/1/2023 in #❓┊help
datepicker state update
`
Forms\Components\DatePicker::make('plan_started')
->reactive()
->afterStateUpdated(function (Get $get, Set $set, ?string $state) {
Log::debug('state', [$state]);
$state = Carbon::parse($state);
$exp = $get('plan_term') == 'year' ? $state->addYear() : $state->addMonth();
$set('plan_expires', $exp);
Log::debug('exp date', [$exp]);
})
->format('Y-m-d')
->displayFormat('d-m-Y'),


Forms\Components\DatePicker::make('plan_expires')
->format('Y-m-d')
->displayFormat('d-m-Y')
->disabled(),
`
Forms\Components\DatePicker::make('plan_started')
->reactive()
->afterStateUpdated(function (Get $get, Set $set, ?string $state) {
Log::debug('state', [$state]);
$state = Carbon::parse($state);
$exp = $get('plan_term') == 'year' ? $state->addYear() : $state->addMonth();
$set('plan_expires', $exp);
Log::debug('exp date', [$exp]);
})
->format('Y-m-d')
->displayFormat('d-m-Y'),


Forms\Components\DatePicker::make('plan_expires')
->format('Y-m-d')
->displayFormat('d-m-Y')
->disabled(),
`
17 replies
FFilament
Created by mugiwara on 9/1/2023 in #❓┊help
datepicker state update
v3
17 replies
FFilament
Created by mugiwara on 9/1/2023 in #❓┊help
datepicker state update
sorry i delete when i try to figure out. there is reactive() in the working code (v2) but still i couldnt work in (v)
17 replies