lolmaheen
rendering Relation Manager table on a custom blade page
Is it possible to render a relation manager table out of resource file
I have class User Profile that extends a layout class User Profile Layout extends Page (this is linked to the resource)
and for User Profile t i am using a custom blade view
just to give an idea
<x-layouts.user-profile>
<livewire:likes-table :user="$this->record" />
<livewire:comments-table :user="$this->record" />
</x-layouts.user-profile>
I also have relation managers in user resource and they are working fine on edit page
how can i render the same relation managers for likes table
and comments table instead of using a table component class(for likes and comments2 replies
Helper Text as Action not working
in my resource file, in form under a field my helper text is rendering but i want to trigger an action when clicking on it
function in resource
public function testAction(): Action
{
return Action::make('test')
->requiresConfirmation()
->action(function (array $arguments) {
dd('Test action called', $arguments);
});
}
PhoneInput::make('telephone')
->label('Phone')
->required()
->helperText(function () {
return view('forms.components.duplicate-hint' );
})
->live(),
blade file for helper text
@if(isset($duplicates) && $duplicates->isNotEmpty())
<div>
<button wire:click="mountAction('test', { id: 12345 })" style="color:red; text-decoration: underline;">
Duplicate(s) found!
</button>
</div>
<x-filament-actions::modals />
@endif
but my action is not triggering5 replies
Text Input Column Validation Not Working
Hi,
I am trying to add a rule (validation check ) to the date text input column rendered in table builder but for some reason it is not working
also is there any way i can access the record in the function because unable to do that as well; it gives the input state
Code:
TextInputColumn::make('deadline')
->type('date')
->rules([
fn ($record, $component) => function ($attributes, $value, $fail) use ($record) {
if ($value < now()->format('Y-m-d')) {
$fail('Closing date must be greater than or equal to ' . now()->format('Y-m-d'));
} elseif ($value < $record->deadline?->format('Y-m-d')) {
$fail("Closing date must be greater than or equal to last saved date ({$record->deadline->format('Y-m-d')})");
}
},
'nullable'], )
->getStateUsing(fn ($record) => $record->deadline?->format('Y-m-d')),
4 replies