PluginYML
PluginYML
FFilament
Created by PluginYML on 5/24/2024 in #❓┊help
Realtion is not displayed
Hello everyone, strangely enough, my relationship is not displayed: TenantResource:
public static function getRelations(): array
{
return [
UsersRelationManager::class
];
}
public static function getRelations(): array
{
return [
UsersRelationManager::class
];
}
UsersRelationManager:
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,
]));
}
}
Tenant:
public function users(): HasMany
{
return $this->hasMany(User::class);
}
public function users(): HasMany
{
return $this->hasMany(User::class);
}
Does anyone know what could be causing this?
2 replies
FFilament
Created by PluginYML on 8/18/2023 in #❓┊help
Ticket System Ticket Overview
6 replies