mirror of
https://github.com/jez500/pricebuddy.git
synced 2026-11-24 19:58:13 +01:00
30 lines
657 B
PHP
30 lines
657 B
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\StoreResource\Widgets;
|
|
|
|
use App\Models\Store;
|
|
use Filament\Widgets\Widget;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class TestResultsWidget extends Widget
|
|
{
|
|
public Model|Store|null $record = null;
|
|
|
|
protected static string $view = 'filament.resources.store-resource.widgets.test-results-widget';
|
|
|
|
public static function canView(): bool
|
|
{
|
|
return session()->has('test_scrape');
|
|
}
|
|
|
|
protected function getViewData(): array
|
|
{
|
|
$results = session()->pull('test_scrape');
|
|
|
|
return [
|
|
'scrape' => $results,
|
|
'record' => $this->record,
|
|
];
|
|
}
|
|
}
|