record = $record; } public function form(Schema $schema): Schema { return $schema ->components([ Textarea::make('message')->required()->rows(2)->label('Add a new note'), ]) ->statePath('data'); } public function create(): void { dd($this->form->getState()); } public function table(Table $table): Table { return $table // ->headerActions([ // Action::make() // ->label('New note') // ->icon('phosphor-plus') // ->action(function () { // UserNote::insert(['event_id' => $this->record->id, 'bookmaker_id' => auth()->user()->bookmaker_id, 'user_id' => auth()->user()->id]); // }), // ]) ->query(UserNote::query()->where('event_id', $this->record->id)->where('bookmaker_id', auth()->user()->bookmaker_id)->where('user_id', auth()->user()->id)) ->columns([ TextColumn::make('message')->label('Notes'), ]) ->filters([ // ... ]) ->recordActions([ // ... ]) ->toolbarActions([ ]); } public function render(): View { return view('livewire.edit-user-note'); } }