File tree Expand file tree Collapse file tree 3 files changed +46
-0
lines changed
Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,21 @@ public static function table(Table $table): Table
166166 ->hidden (fn (Result $ record ): bool => ! $ record ->is_successful )
167167 ->openUrlInNewTab (),
168168 Tables \Actions \ViewAction::make (),
169+ Tables \Actions \Action::make ('updateComments ' )
170+ ->icon ('heroicon-o-annotation ' )
171+ ->mountUsing (fn (Forms \ComponentContainer $ form , Result $ record ) => $ form ->fill ([
172+ 'comments ' => $ record ->comments ,
173+ ]))
174+ ->action (function (Result $ record , array $ data ): void {
175+ $ record ->comments = $ data ['comments ' ];
176+ $ record ->save ();
177+ })
178+ ->form ([
179+ Forms \Components \Textarea::make ('comments ' )
180+ ->rows (6 )
181+ ->maxLength (500 ),
182+ ])
183+ ->modalButton ('Save ' ),
169184 Tables \Actions \DeleteAction::make (),
170185 ]),
171186 ])
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ class Result extends Model
3030 'server_host ' ,
3131 'server_name ' ,
3232 'url ' ,
33+ 'comments ' ,
3334 'scheduled ' ,
3435 'successful ' ,
3536 'data ' ,
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use Illuminate \Database \Migrations \Migration ;
4+ use Illuminate \Database \Schema \Blueprint ;
5+ use Illuminate \Support \Facades \Schema ;
6+
7+ return new class extends Migration
8+ {
9+ /**
10+ * Run the migrations.
11+ *
12+ * @return void
13+ */
14+ public function up ()
15+ {
16+ Schema::table ('results ' , function (Blueprint $ table ) {
17+ $ table ->text ('comments ' )->nullable ()->after ('url ' );
18+ });
19+ }
20+
21+ /**
22+ * Reverse the migrations.
23+ *
24+ * @return void
25+ */
26+ public function down ()
27+ {
28+ //
29+ }
30+ };
You can’t perform that action at this time.
0 commit comments