Files
Cybrarist a4fa59e95d enable chromium crawler for best buy canada and see
add reset link functionality if name and image were fetched as error
don't replace link name and image if crawled already
fix route cache
add fetch action to single link
fix issue where price history doesn't show all the time by parsing date first
fix product delete when category exists
fix currency error if user selects a currency without an api key
2026-01-20 22:38:29 +04:00

51 lines
1.5 KiB
PHP

<?php
namespace App\Filament\Resources\Links\Pages;
use App\Filament\Resources\Links\LinkResource;
use App\Helpers\LinkHelper;
use App\Http\Controllers\Actions\FetchSingleLinkAction;
use Filament\Actions\Action;
use Filament\Notifications\Notification;
use Filament\Resources\Pages\EditRecord;
use Filament\Support\Icons\Heroicon;
class EditLink extends EditRecord
{
protected static string $resource = LinkResource::class;
protected function getHeaderActions(): array
{
return [
Action::make('open')
->outlined()
->icon(Heroicon::Link)
->url(fn ($record) => LinkHelper::get_url($record), true),
Action::make('reset_link')
->icon(Heroicon::Backspace)
->tooltip('Reset name and image, and fill them again on next fetch')
->action(function ($record) {
$record->update([
'name' => null,
'image' => null,
]);
Notification::make()
->title('name and image reseted successfully')
->success()
->send();
$this->fillForm();
}),
Action::make('Fetch')
->icon(Heroicon::ArrowPath)
->color('success')
->action(fn ($record) => new FetchSingleLinkAction()->__invoke($record)),
];
}
}