LucaCvg
ToggleColumn and Modal Confirmation (Action?)
Hi, I'm trying to understand how to make a modal appear when clicking on a field set as "ToggleColumn".
I also tried with
updateStateUsing()
method , afterStateUpdated()
method, beforeStateUpdated()
method but I can't get the modal to appear:
Tables\Columns\ToggleColumn::make('monitorable')
->label("É Monitorabile?")
->onColor(fn ($record) => $record->monitorable ? 'success' : 'danger')
->offColor('danger')
->onIcon('heroicon-m-check')
->offIcon('heroicon-m-x-mark')
->alignment(Alignment::Center)
->beforeStateUpdated(function () {
Action::make('updateMonitorablesNotes')
->form([
Select::make('monitorable_notes')
->label('Motivo Esclusione')
->options([
...
...
])
->required(),
]);
}),
Do you have any advice?
Thank you!3 replies
How to compare two fields value of different tables in Relation Manager?
HI! I'm trying to compare two values, using "Relation Manager", unfortunately without success.
The fields I'm trying to compare are in two different tables, related to each other.
I would like to be able to compare the "estimate_at_completion" field which is present in the table "EarnedValue" with the "budget_to_complete" field which is present in the table "wbe".
i cant get the value of "wbe.budget_to_complete"
Tables\Columns\TextColumn::make('estimate_at_completion')
->label('EAC')
->badge()
->color(fn ($state): string => floatval($state) < floatval('wbe.budget_to_complete') ? 'success' : 'danger')
6 replies
Showing Multiple Charts (ChartWidget) in ViewPage
Hi everyone. I would like to be able to show two graphs (ChartWidget) at the bottom of each detail page.
I created the Widgets and I'm using the getFooterWidgets() function in View to show the graph and it works, but with one graph at a time and not with both together.
However, I don't know what I need to write to be able to show two graphs and not just one.
protected function getFooterWidgets(): array
{
return [WbeStatsKpiChart::class];
}
Widget pages exist, but they can only show one chart at a time.
- WbeStatsKpiChart
protected function getFooterWidgets(): array
{
return [WbeStatsKpiChart::class];
}
- WbeStatsCostChart
protected function getFooterWidgets(): array
{
return [WbeStatsCostChart::class];
}
It's wrong but the result I would like to obtain is like this:
protected function getFooterWidgets(): array
{
return [WbeStatsKpiChart::class];
return [WbeStatsCostChart::class];
}
Thank you!4 replies
RepeatableEntry on InfoList dont show any data
Hi everyone (I'm a beginner)! I have a problem, perhaps trivial, when I try to use a "RepeatableEntry" and "TextEntry" inside an "InfoList" with a relationship with two tables called "wbes" and "earned_values".
Inside the "WbeResource.php" write this code, but no data appears in the FE:
Components\Section::make("REPEATER")
->schema([
RepeatableEntry::make('earnedvalue')
->schema([
TextEntry::make('id'),
])
])
This is the "Wbe.php" model that contains a relationship:
public function earnedvalue(): HasMany
{
return $this->hasMany(EarnedValue::class , 'id', 'wbe_id');
}
This is the DB (earned_values) table:
id (PK)
practice_id (FK)
practice_manager_id (FK)
project_manager_id (FK)
wbe_id (FK)
name
In your opinion, where am I going wrong?
Thank you!4 replies