-
-
Notifications
You must be signed in to change notification settings - Fork 358
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
What happened?
When using a date column and formatting the date output. When a NULL value is recevied an error is thrown. Even when using ->emptyValue('Not Found')
as per docs.
How to reproduce the bug
Set columns
public function columns(): array
{
return [
Column::make("Id", "id")
->sortable(),
Column::make("Booking id", "booking.ref")
->sortable()
->searchable(),
Column::make("Invoice id", "invoice.inv_number")
->sortable()
->searchable(),
Column::make("Staff id", "staff.first_name")
->sortable()
->searchable(),
DateColumn::make("Paid date", "paid_date")
->sortable()
->emptyValue('NOT PAID YET')
->outputFormat('d/m/Y'),
Column::make('Actions')
->label(
fn($row, Column $column) => view('livewire.commission.commission-table-actions')->with(
[
'id' => $row->id,
]
)
)->html(),
];
}
Have record in Databse that is NULL.
Error is thrown:
Carbon\Factory::hasFormatWithModifiers(): Argument #1 ($date) must be of type string, null given, called in C:\laragon\www\pems\vendor\nesbot\carbon\src\Carbon\Traits\Comparison.php on line 822
Package Version
3.2.5
PHP Version
8.2.x
Laravel Version
11.8.0
Alpine Version
No response
Theme
Tailwind 3.x
Notes
Running Livewire 3.5
Error Message
Carbon\Factory::hasFormatWithModifiers(): Argument #1 ($date) must be of type string, null given, called in C:\laragon\www\pems\vendor\nesbot\carbon\src\Carbon\Traits\Comparison.php on line 822
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working