mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
migration script
# Conflicts: # app/Filament/Resources/Torrent/AnnounceLogResource.php
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Resources\User\HitAndRunResource\Pages;
|
||||
|
||||
use Filament\Actions\DeleteAction;
|
||||
use App\Filament\Resources\User\HitAndRunResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
@@ -13,7 +14,7 @@ class EditHitAndRun extends EditRecord
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
namespace App\Filament\Resources\User\HitAndRunResource\Pages;
|
||||
|
||||
use Filament\Actions\Action;
|
||||
use Exception;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use App\Filament\Resources\User\HitAndRunResource;
|
||||
use App\Models\HitAndRun;
|
||||
use App\Repositories\HitAndRunRepository;
|
||||
@@ -82,7 +85,7 @@ class ViewHitAndRun extends ViewRecord
|
||||
{
|
||||
$actions = [];
|
||||
if (in_array($this->record->status, HitAndRun::CAN_PARDON_STATUS)) {
|
||||
$actions[] = Actions\Action::make('Pardon')
|
||||
$actions[] = Action::make('Pardon')
|
||||
->requiresConfirmation()
|
||||
->action(function () {
|
||||
$hitAndRunRep = new HitAndRunRepository();
|
||||
@@ -90,14 +93,14 @@ class ViewHitAndRun extends ViewRecord
|
||||
$hitAndRunRep->pardon($this->record->id, Auth::user());
|
||||
send_admin_success_notification();
|
||||
$this->record = $this->resolveRecord($this->record->id);
|
||||
} catch (\Exception $exception) {
|
||||
} catch (Exception $exception) {
|
||||
send_admin_fail_notification($exception->getMessage());
|
||||
}
|
||||
})
|
||||
->label(__('admin.resources.hit_and_run.action_pardon'))
|
||||
;
|
||||
}
|
||||
$actions[] = Actions\DeleteAction::make();
|
||||
$actions[] = DeleteAction::make();
|
||||
|
||||
return $actions;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user