Skjena
Encounter a network issue while uploading a file using SpatieMediaLibraryFileUpload
When I create a record without using file upload, it is successfully created. However, when I attempt to create a record with a file, it encounters a network issue, but the record is still successfully created.
9 replies
How can I access the table filter value within the getTableQuery() function of a table widget?
Inside getTableFilters(), I created my filter fields and want to get the filter value within the getTableQuery() function to customize the table query accordingly.
18 replies
Typed property Filament\Widgets\TableWidget::$table must not be accessed before initialization.
$this->getTableFilterState("key")["value"]
returns the error $table must not be used before initialisation when I try to retrieve the current filter value.7 replies
Value keeps getting deleted automatically inside TextInput field.
Some values are immediately removed while typing in the TextInput field, especially when typing quickly.
Here is that TextInput field code
i think the issue with
reactive()
and live()
, because when i use lazy()
there is no such issue.
Could you help me out with this issue ? Thanks.6 replies
The dynamic toggle button is not working and has the value null saved.
When I select an asset type in AssetResource, the AssetTypeResource's associated schema is made available for filling out, with the exception of the toggle button. I have built an AssetTypeResource where I have established the schema for a certain asset type. When I first created an asset the toggle button field, stored the null value rather than the value true/false; yet, on the edit page, the value true/false is saved.
14 replies
How do I display the time (hh:mm) on the yaxis of a linechart?
Here is my code
protected function getData(): array
{
$data = Attendance::where('user_id', 1)
->where('attendance_month', '2023-06-01')
->orderBy('check_in')
->get()
->groupBy(function ($attendance) {
return Carbon::parse($attendance->check_in)->format('Y-m-d'); // Group by date
})
->map(function ($groupedAttendances) {
$firstCheckIn = $groupedAttendances->first()->check_in;
$timezone = config('app.user_timezone');
return Carbon::parse($firstCheckIn)->timezone($timezone)->format('Y-m-d H:i:s'); // Get the first check-in time of each day
})
->toArray();
$days = array_map(function ($value) {
return date('d', strtotime($value));
}, array_keys($data));
$times = array_map(function ($value) {
return date('h:i', strtotime($value));
}, array_values($data));
return [
'datasets' => [
[
'label' => 'User checkin time',
'data' => $times,
'borderColor' => 'rgb(61, 178, 106)',
'backgroundColor' => 'rgb(61, 178, 106)',
'borderWidth' => 2,
'tension' => 0.3,
'fill' => false,
'pointRadius' => 2,
'height' => 100
],
],
'labels' => $days
];
}
14 replies