diff --git a/app/Filament/Resources/ResultResource.php b/app/Filament/Resources/ResultResource.php index a74758e4c..e97430285 100644 --- a/app/Filament/Resources/ResultResource.php +++ b/app/Filament/Resources/ResultResource.php @@ -166,6 +166,21 @@ public static function table(Table $table): Table ->hidden(fn (Result $record): bool => ! $record->is_successful) ->openUrlInNewTab(), Tables\Actions\ViewAction::make(), + Tables\Actions\Action::make('updateComments') + ->icon('heroicon-o-annotation') + ->mountUsing(fn (Forms\ComponentContainer $form, Result $record) => $form->fill([ + 'comments' => $record->comments, + ])) + ->action(function (Result $record, array $data): void { + $record->comments = $data['comments']; + $record->save(); + }) + ->form([ + Forms\Components\Textarea::make('comments') + ->rows(6) + ->maxLength(500), + ]) + ->modalButton('Save'), Tables\Actions\DeleteAction::make(), ]), ]) diff --git a/app/Models/Result.php b/app/Models/Result.php index fd5341873..34b663ba1 100644 --- a/app/Models/Result.php +++ b/app/Models/Result.php @@ -30,6 +30,7 @@ class Result extends Model 'server_host', 'server_name', 'url', + 'comments', 'scheduled', 'successful', 'data', diff --git a/database/migrations/2023_02_12_131620_add_comments_to_results_table.php b/database/migrations/2023_02_12_131620_add_comments_to_results_table.php new file mode 100644 index 000000000..99851e84b --- /dev/null +++ b/database/migrations/2023_02_12_131620_add_comments_to_results_table.php @@ -0,0 +1,30 @@ +text('comments')->nullable()->after('url'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +};