F
Filament15mo ago
Jocka

Edit not working in relation manager.

Hello guys, i have a relation manager when i show winery settings in it. But for some reason the edit button is not showing. Here is my code.
<?php

namespace App\Filament\Resources\WineryResource\RelationManagers;

use Filament\Forms;
use Filament\Forms\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Tables;
use Filament\Tables\Table;

class WinerySettingsRelationManager extends RelationManager
{
protected static string $relationship = 'winerySettings';

public function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('value')
->required()
->maxLength(255),
]);
}

public function table(Table $table): Table
{
return $table
->recordTitleAttribute('description')
->columns([
Tables\Columns\TextColumn::make('description'),
Tables\Columns\TextColumn::make('value'),
])
->filters([
//
])
->headerActions([
//
])
->actions([
Tables\Actions\EditAction::make(),
//
])
->bulkActions([
//
])
->emptyStateActions([
//
]);
}
}
<?php

namespace App\Filament\Resources\WineryResource\RelationManagers;

use Filament\Forms;
use Filament\Forms\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Tables;
use Filament\Tables\Table;

class WinerySettingsRelationManager extends RelationManager
{
protected static string $relationship = 'winerySettings';

public function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('value')
->required()
->maxLength(255),
]);
}

public function table(Table $table): Table
{
return $table
->recordTitleAttribute('description')
->columns([
Tables\Columns\TextColumn::make('description'),
Tables\Columns\TextColumn::make('value'),
])
->filters([
//
])
->headerActions([
//
])
->actions([
Tables\Actions\EditAction::make(),
//
])
->bulkActions([
//
])
->emptyStateActions([
//
]);
}
}
2 Replies
Jocka
JockaOP15mo ago
Also the policy enables the user to edit it.
cheesegrits
cheesegrits15mo ago
Is this in an Edit or View page? By default, Filament now hides all edit/create/etc actions on View pages. https://filamentphp.com/docs/3.x/panels/resources/relation-managers#read-only-mode
Want results from more Discord servers?
Add your server