Get Model id on Widget

hi all, i've this widget:

class MessageWidgetTable extends BaseWidget
{
    public function table(Table $table): Table
    {
        return $table
            ->heading('')
            ->query(
                Message::query()->where('casting_id', 22)
            )
            ->columns([
                Tables\Columns\TextColumn::make('body')->label('Text')->limit(100),
                Tables\Columns\TextColumn::make('created_at')->label('Send at')->dateTime('d M Y - H:i'),
            ])
            ->actions([
                ViewAction::make()
                ->modalHeading('Text')
                ->infolist([
                    TextEntry::make('body')->markdown()->hiddenLabel(),
                    TextEntry::make('users_count')
                    ->getStateUsing(fn ($record) => $record->users->count())
                    ->label('N. Users that read at'),
                    RepeatableEntry::make('users')
                    ->label('Readers')
                    ->schema([
                        TextEntry::make('first_name')->hiddenLabel(),
                        TextEntry::make('last_name')->hiddenLabel(),
                        TextEntry::make('pivot.read_at')->date('d M Y - H:i')->hiddenLabel(),
                    ])
                    ->columns(3)
                ]),
                
                
            ]);
    }

}


but how i can find the id of casting here Message::query()->where('casting_id', 22)

?
Was this page helpful?