CategoryID column is not sending data, can you help?

Although I sent 7 selected data, why is the data I selected in the category_id column not going?
\Filament\Forms\Components\Card::make([
TextInput::make('title')
->required()
->maxLength(255)
->label('Blog İsmi'),
Forms\Components\RichEditor::make('content')->label('İçerik'),
Select::make('category_id')
->relationship(name: 'category', titleAttribute: 'name') ->label('Kategori Adı')->multiple()->preload(),
Select::make('publish_status')
->options([
false => 'Yayınlanmadı',
true => 'Yayınlandı',
])->required()->label('Yayınlanma Durumu'),
TextInput::make('author')
->required()
->maxLength(255)
->label('Yazar İsmi'),
TextInput::make('cover')
->required()
->maxLength(255)
->label('Yazar İsmi'),
Forms\Components\Hidden::make('user_id')->default(Auth::id()),
])
\Filament\Forms\Components\Card::make([
TextInput::make('title')
->required()
->maxLength(255)
->label('Blog İsmi'),
Forms\Components\RichEditor::make('content')->label('İçerik'),
Select::make('category_id')
->relationship(name: 'category', titleAttribute: 'name') ->label('Kategori Adı')->multiple()->preload(),
Select::make('publish_status')
->options([
false => 'Yayınlanmadı',
true => 'Yayınlandı',
])->required()->label('Yayınlanma Durumu'),
TextInput::make('author')
->required()
->maxLength(255)
->label('Yazar İsmi'),
TextInput::make('cover')
->required()
->maxLength(255)
->label('Yazar İsmi'),
Forms\Components\Hidden::make('user_id')->default(Auth::id()),
])
No description
No description
2 Replies
Dennis Koch
Dennis Koch8mo ago
You used relationship(). It's stored as the relationship and not included in the data. Btw. never use hidden fields for important data like user_id. That data can be modified.
Mehmet K.
Mehmet K.8mo ago
Thank you for the user_id warning. How can I list this data as select except Relationship?