File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
app/Filament/Resources/AIRecordMatchResource/Pages Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace App \Filament \Resources \AIRecordMatchResource \Pages ;
4+
5+ use App \Filament \Resources \AIRecordMatchResource ;
6+ use App \Models \AISuggestedMatch ;
7+ use Filament \Pages \Actions ;
8+ use Filament \Resources \Pages \ListRecords ;
9+ use Illuminate \Support \Facades \Http ;
10+
11+ class ReviewMatches extends ListRecords
12+ {
13+ protected static string $ resource = AIRecordMatchResource::class;
14+
15+ protected function getTableActions (): array
16+ {
17+ return [
18+ Actions \Action::make ('confirm ' )
19+ ->label ('Confirm ' )
20+ ->action (function (AISuggestedMatch $ record ) {
21+ // call controller endpoint
22+ Http::post (route ('ai.matches.confirm ' , ['suggestion ' => $ record ->id ]));
23+ $ this ->notify ('success ' , 'Confirmed ' );
24+ }),
25+ Actions \Action::make ('reject ' )
26+ ->label ('Reject ' )
27+ ->action (function (AISuggestedMatch $ record ) {
28+ Http::post (route ('ai.matches.reject ' , ['suggestion ' => $ record ->id ]));
29+ $ this ->notify ('success ' , 'Rejected ' );
30+ }),
31+ ];
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments