Adds three resources under a new "Forecasting" navigation group: a full-CRUD WatchedEventResource for the Layer 5 volatility detector, plus read-only WeeklyForecastResource and BacktestResource so the ridge model output and its calibration can be inspected without SQL. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
63 lines
1.7 KiB
PHP
63 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\WeeklyForecasts;
|
|
|
|
use App\Filament\NavigationGroup;
|
|
use App\Filament\Resources\WeeklyForecasts\Pages\ListWeeklyForecasts;
|
|
use App\Filament\Resources\WeeklyForecasts\Pages\ViewWeeklyForecast;
|
|
use App\Filament\Resources\WeeklyForecasts\Schemas\WeeklyForecastInfolist;
|
|
use App\Filament\Resources\WeeklyForecasts\Tables\WeeklyForecastsTable;
|
|
use App\Models\WeeklyForecast;
|
|
use BackedEnum;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Support\Icons\Heroicon;
|
|
use Filament\Tables\Table;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class WeeklyForecastResource extends Resource
|
|
{
|
|
protected static ?string $model = WeeklyForecast::class;
|
|
|
|
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedChartBar;
|
|
|
|
protected static string|\UnitEnum|null $navigationGroup = NavigationGroup::Forecasting;
|
|
|
|
protected static ?string $navigationLabel = 'Weekly Forecasts';
|
|
|
|
protected static ?int $navigationSort = 2;
|
|
|
|
public static function infolist(Schema $schema): Schema
|
|
{
|
|
return WeeklyForecastInfolist::configure($schema);
|
|
}
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return WeeklyForecastsTable::configure($table);
|
|
}
|
|
|
|
public static function canCreate(): bool
|
|
{
|
|
return false;
|
|
}
|
|
|
|
public static function canEdit(Model $record): bool
|
|
{
|
|
return false;
|
|
}
|
|
|
|
public static function canDelete(Model $record): bool
|
|
{
|
|
return false;
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => ListWeeklyForecasts::route('/'),
|
|
'view' => ViewWeeklyForecast::route('/{record}'),
|
|
];
|
|
}
|
|
}
|