From fde7c758d7ce8682f40391fa19e3fe0d0260d436 Mon Sep 17 00:00:00 2001 From: Russ Long Date: Sat, 6 Aug 2022 19:19:33 -0400 Subject: [PATCH] category relationship --- app/Filament/Resources/CarShowCategoryResource.php | 1 - .../RelationManagers/VehicleRelationManager.php | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Filament/Resources/CarShowCategoryResource.php b/app/Filament/Resources/CarShowCategoryResource.php index d496c7b..ac77eda 100644 --- a/app/Filament/Resources/CarShowCategoryResource.php +++ b/app/Filament/Resources/CarShowCategoryResource.php @@ -18,7 +18,6 @@ use Filament\Tables\Columns\TextColumn; use Filament\Forms\Components\TextInput; use Filament\Forms\Components\Toggle; - class CarShowCategoryResource extends Resource { protected static ?string $model = CarShowCategory::class; diff --git a/app/Filament/Resources/CarShowCategoryResource/RelationManagers/VehicleRelationManager.php b/app/Filament/Resources/CarShowCategoryResource/RelationManagers/VehicleRelationManager.php index 2ec0c9e..72cf50c 100644 --- a/app/Filament/Resources/CarShowCategoryResource/RelationManagers/VehicleRelationManager.php +++ b/app/Filament/Resources/CarShowCategoryResource/RelationManagers/VehicleRelationManager.php @@ -14,13 +14,13 @@ class VehicleRelationManager extends RelationManager { protected static string $relationship = 'vehicle'; - protected static ?string $recordTitleAttribute = 'type'; + protected static ?string $recordTitleAttribute = 'id'; public static function form(Form $form): Form { return $form ->schema([ - Forms\Components\TextInput::make('type') + Forms\Components\TextInput::make('id') ->required() ->maxLength(255), ]); @@ -30,7 +30,7 @@ class VehicleRelationManager extends RelationManager { return $table ->columns([ - Tables\Columns\TextColumn::make('type'), + Tables\Columns\TextColumn::make('id'), Tables\Columns\TextColumn::make('owner'), Tables\Columns\TextColumn::make('year'), Tables\Columns\TextColumn::make('make'),