Renan Pereira
Modal not working on Firefox
I have a project and the modals are working on Chrome, Opera, Safari. I found a bug report to the livewire repo that matches what we are facing, anyone else having this issue?
Link to github discussion: https://github.com/livewire/livewire/discussions/7746),
16 replies
Table ExportAction failing on relationship
Whenever I try to export a table and add a relationship column with the dot notation the job fails, however no error is displayed
Here is my code, the relationship is BelongsTo Funcionario, if I use funcionario_id it works but with funcionario.nome the job fails.
class EntradaExporter extends Exporter
{
protected static ?string $model = Entrada::class;
public static function getColumns(): array
{
return [
ExportColumn::make('id')
->label('ID'),
ExportColumn::make('funcionario.nome'),
ExportColumn::make('obra_id'),
ExportColumn::make('dt_entrada'),
ExportColumn::make('created_at'),
ExportColumn::make('updated_at'),
ExportColumn::make('deleted_at'),
ExportColumn::make('dt_saida'),
ExportColumn::make('created_by'),
ExportColumn::make('updated_by'),
ExportColumn::make('deleted_by'),
];
}
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your entrada export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.';
}
return $body;
}
}
2 replies
EditAction enabling hidden CreateAction in headerActions
I know it sounds a bit confusing but I'll try my best to explain. I have a CreateAction as a headerAction of a table and it has the hidden function and when first loading the page the CreateAction is hidden which is what I want, however when I click on the EditAction the modal opens and the CreateAction button is visible which shouldn't happen. Is this a bug?
Link to video: https://www.loom.com/share/140f468dde0c4f858f1e9f9c9f6fc9d2?sid=fd2e9f6d-2cc1-4a32-9753-ddaf2be27495
20 replies
Export Column State Not Working
Hi guys,
I have a boolean column in a relationship model and I want to personalize it so true means yes and false means no, however it's not customizing by state on the Exporter class. I'm getting 1 or 0 with or without state, is this a bug or am I doing something wrong?
public static function getColumns(): array
{
return [
ExportColumn::make('docto.obrigatorio')
->label('Obrigatório')
->state(function (EmpresaDocto $record) {
if ($record->docto->obrigatorio === 1) {
return 'Sim';
}
return 'Não';
}),
];
}
19 replies