PluginYML
Realtion is not displayed
Hello everyone,
strangely enough, my relationship is not displayed:
TenantResource:
UsersRelationManager:
Tenant:
Does anyone know what could be causing this?
public static function getRelations(): array
{
return [
UsersRelationManager::class
];
}
public static function getRelations(): array
{
return [
UsersRelationManager::class
];
}
class UsersRelationManager extends RelationManager
{
protected static string $relationship = 'users';
public function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('email')
->required()
->maxLength(255),
]);
}
public function table(Table $table): Table
{
return $table
->recordTitleAttribute('email')
->columns([
Tables\Columns\TextColumn::make('email'),
])
->filters([
Tables\Filters\TrashedFilter::make()
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
Tables\Actions\ForceDeleteAction::make(),
Tables\Actions\RestoreAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
Tables\Actions\RestoreBulkAction::make(),
Tables\Actions\ForceDeleteBulkAction::make(),
]),
])
->modifyQueryUsing(fn(Builder $query) => $query->withoutGlobalScopes([
SoftDeletingScope::class,
]));
}
}
class UsersRelationManager extends RelationManager
{
protected static string $relationship = 'users';
public function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('email')
->required()
->maxLength(255),
]);
}
public function table(Table $table): Table
{
return $table
->recordTitleAttribute('email')
->columns([
Tables\Columns\TextColumn::make('email'),
])
->filters([
Tables\Filters\TrashedFilter::make()
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
Tables\Actions\ForceDeleteAction::make(),
Tables\Actions\RestoreAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
Tables\Actions\RestoreBulkAction::make(),
Tables\Actions\ForceDeleteBulkAction::make(),
]),
])
->modifyQueryUsing(fn(Builder $query) => $query->withoutGlobalScopes([
SoftDeletingScope::class,
]));
}
}
public function users(): HasMany
{
return $this->hasMany(User::class);
}
public function users(): HasMany
{
return $this->hasMany(User::class);
}
2 replies