F
Filament•9mo ago
MikePageDev

Row actions in relationship manager not doing anything

I have the folowing in my table method
->actions([
Table\Actions\EditAction::make(),
Tables\Actions\DissociateAction::make(),
])
->actions([
Table\Actions\EditAction::make(),
Tables\Actions\DissociateAction::make(),
])
but when I click on the buttons nothing hapens. Any ideas on what might be happerning?
34 Replies
ddoddsr
ddoddsr•9mo ago
Is it
Tables\Actions\EditAction::make(),
Tables\Actions\EditAction::make(),
?
MikePageDev
MikePageDevOP•9mo ago
That is a typo of me typing it in here sorry BTW, this is on a many-to-many relationship with pivot attributes. I have tried creating a new Relationship Manager and still the defualt row buttons do not do anything. Hi we have found that other relationship manager table dissociate buttons are not doing anything. Realy could do with some help with this please. Still looking for some help on this.
toeknee
toeknee•9mo ago
What version of filament, can what console errors exist when you click said buttons Have you build a form on the relation manager?
MikePageDev
MikePageDevOP•9mo ago
@toeknee v3, there are no errors, I have built a from in the relation manager
toeknee
toeknee•9mo ago
Please provide the action and the form?
MikePageDev
MikePageDevOP•9mo ago
I also tried with a newly created relationship manager an nothing happend Here are the acctions and form code
Tables\Actions\EditAction::make(),
Tables\Actions\DissociateAction::make(),
Tables\Actions\EditAction::make(),
Tables\Actions\DissociateAction::make(),
->schema([
Select::make('level')
->options([
'platinum' => 'Platinum',
'gold' => 'Gold',
'silver' => 'Silver',
'bronze' => 'Bronze',
'other' => 'Other',
])
->reactive()
->required()
->default('other'),
TextInput::make('level_details')
->label('Level Details')
->visible(fn(callable $get) => $get('level') === 'other')
->required(fn(callable $get) => $get('level') === 'other'),
]);
->schema([
Select::make('level')
->options([
'platinum' => 'Platinum',
'gold' => 'Gold',
'silver' => 'Silver',
'bronze' => 'Bronze',
'other' => 'Other',
])
->reactive()
->required()
->default('other'),
TextInput::make('level_details')
->label('Level Details')
->visible(fn(callable $get) => $get('level') === 'other')
->required(fn(callable $get) => $get('level') === 'other'),
]);
@toeknee dose this help or is there any more if I can give to help diagnose the issue?
toeknee
toeknee•9mo ago
Change relative to live. And remove visible for now
MikePageDev
MikePageDevOP•9mo ago
@toeknee No change unfotunatly. And still no errors in the console.
toeknee
toeknee•9mo ago
Weird.. .can you provide a repoduction repo so we can test
MikePageDev
MikePageDevOP•9mo ago
I will see what I can do.
ericmp
ericmp•9mo ago
@MikePageDev i think this might be the issue: when u created the relation manager u created it like this:
php artisan make:filament-relation-manager CategoryResource posts title --associate
php artisan make:filament-relation-manager CategoryResource posts title --associate
when u actually need this one:
php artisan make:filament-relation-manager CategoryResource posts title --attach
php artisan make:filament-relation-manager CategoryResource posts title --attach
because the relationship is BelongsToMany docs: https://filamentphp.com/docs/3.x/panels/resources/relation-managers#associating-and-dissociating-records vs https://filamentphp.com/docs/3.x/panels/resources/relation-managers#attaching-and-detaching-records
MikePageDev
MikePageDevOP•9mo ago
Thank you for the heads up. I have just changed the accttions from Dissociate to Detach but the row buttons are still not doing anything.
ericmp
ericmp•9mo ago
share the models eloquent relationships
MikePageDev
MikePageDevOP•9mo ago
They are both BelongsToMany
ericmp
ericmp•9mo ago
i mean share the definition of the relationships public function ...
MikePageDev
MikePageDevOP•8mo ago
Would it be to do with the relationship definition if the attach action is working? Hi All I am still having issues with this if someone could help please?
MikePageDev
MikePageDevOP•8mo ago
In the relationship table, I have a header action, attach which is working fine. The issue is that the row actions, edit and detach do nothing.
ericmp
ericmp•8mo ago
can u share the table actions?
MikePageDev
MikePageDevOP•8mo ago
use Filament\Tables\Actions\EditAction;
use Filament\Tables\Actions\AttachAction;
use Filament\Tables\Actions\DetachAction;
use Filament\Tables\Actions\DetachBulkAction;

->headerActions([
AttachAction::make()
->form(fn (AttachAction $action): array => [
$action->getRecordSelect(),
Forms\Components\Toggle::make('qualified')
])
->preloadRecordSelect(),
])
->actions([
EditAction::make(),
DetachAction::make(),
])
->bulkActions([
DetachBulkAction::make(),
]);
use Filament\Tables\Actions\EditAction;
use Filament\Tables\Actions\AttachAction;
use Filament\Tables\Actions\DetachAction;
use Filament\Tables\Actions\DetachBulkAction;

->headerActions([
AttachAction::make()
->form(fn (AttachAction $action): array => [
$action->getRecordSelect(),
Forms\Components\Toggle::make('qualified')
])
->preloadRecordSelect(),
])
->actions([
EditAction::make(),
DetachAction::make(),
])
->bulkActions([
DetachBulkAction::make(),
]);
The DetachBulkAction also works fine
toeknee
toeknee•8mo ago
Please run: php artisan about
MikePageDev
MikePageDevOP•8mo ago
What info ar you looking for?
toeknee
toeknee•8mo ago
filament version.
MikePageDev
MikePageDevOP•8mo ago
Filament .........................................................................................................................................
Packages ......................................................................................... filament, forms, notifications, support, tables
Version .................................................................................................................................. v3.2.34
Filament .........................................................................................................................................
Packages ......................................................................................... filament, forms, notifications, support, tables
Version .................................................................................................................................. v3.2.34
toeknee
toeknee•8mo ago
please update filament first. we are on .69
MikePageDev
MikePageDevOP•8mo ago
OK I will give that a go Just run it, and Filament updates to .47 (still no joy with the actions) @toeknee @ericmp any other thoughts?
toeknee
toeknee•8mo ago
You should be on Filament .69 as per #🏷┊releases I remember someone mentioned it so guessing it might be resolved. once you are on .69 if you still have the issue can you please create a reporduction repo
MikePageDev
MikePageDevOP•8mo ago
I have run composer update and it will only take me to .47
toeknee
toeknee•8mo ago
Does it say why it won't update beyond .47?
MikePageDev
MikePageDevOP•8mo ago
no, just getting a message to say that there is nothing to upgrade
toeknee
toeknee•8mo ago
have you run a composer update?
MikePageDev
MikePageDevOP•8mo ago
Sorry I will get back to this ASAP having some other technical difficulties @toeknee I am now on .69, but the inline accounts are still not doing anything.
toeknee
toeknee•8mo ago
An you create a reproduction repo to debug
MikePageDev
MikePageDevOP•8mo ago
I will see what I can do.
Want results from more Discord servers?
Add your server