dwong98
dwong98
FFilament
Created by dwong98 on 1/15/2024 in #❓┊help
Interecting livewire components with resource table.
No description
4 replies
FFilament
Created by dwong98 on 12/18/2023 in #❓┊help
Positioning record checkbox in contentGrid
Hi all, i have a table that are displaying all the data in grid by using contentGrid. Wanted to know if i can position the record checkbox to right side of the grid? Some example codes.
return $table
->contentGrid([
'md' => 3,
'xl' => 4
])
->recordCheckboxPosition(RecordCheckboxPosition::AfterCells)
->recordUrl(null) // to disable table row clickable.
->defaultSort('created_at', 'desc')
->columns([
Tables\Columns\Layout\Stack::make([
// all the components..
])
return $table
->contentGrid([
'md' => 3,
'xl' => 4
])
->recordCheckboxPosition(RecordCheckboxPosition::AfterCells)
->recordUrl(null) // to disable table row clickable.
->defaultSort('created_at', 'desc')
->columns([
Tables\Columns\Layout\Stack::make([
// all the components..
])
based on documentation, i can change the checkbox position either BeforeCells or AfterCells, but seems like it wont work if i have a Stack layout wrapping all the components.
5 replies
FFilament
Created by dwong98 on 11/20/2023 in #❓┊help
Getting previous child relationship data before saving the parent data.
Hi, i am trying to create a version control on a model. Let's say i have a model called Assets, and Assets can have many different versions. Once a user click 'save' in the edit page, I used hooks in EditAssets to create an record in asset versions control table first, then only continue updating the model. However, i can't to seems to get the old child relationships' data, but the parent Model works fine as i can get it through
$this->record
$this->record
I have tried to get the old children relationships' data at afterValidate by calling
$this->record->load('all_the_child_relationships')
$this->record->load('all_the_child_relationships')
but this will get the latest relationship data instead of the old / previous one. Is this because the relationship was synced / save as soon as the 'save' button is clicked? If this is the reason, any way that i can get the old relationships data before saving it?
2 replies