Laravel Filament adding data to multiple tables

I need to add data to more than one table with belongsToMany in the project I developed with Laravel filament.

Example DB:

  • Category: id, name
  • Anime: id, name, description
  • AnimeCategory: id, category_id, anime_id

Code:

I am getting categoryId not found error in Anime Table.

Found in Anime Resource:

Select::make('categoryId')
    ->label('Kategori seçiniz')
    ->placeholder('Kategori Seçiniz')
    ->required()
    ->multiple()
    ->options(function () {
        return Category::all()->pluck('title', 'id');
    }),

How can I add selected multi-category id data to AnimeCategory table?