|
@@ -3,6 +3,8 @@
|
|
namespace App\Filament\Widgets;
|
|
namespace App\Filament\Widgets;
|
|
|
|
|
|
use App\Models\Domain;
|
|
use App\Models\Domain;
|
|
|
|
+use App\Models\HostingSubscription;
|
|
|
|
+use App\Models\PhyreServer;
|
|
use Filament\Tables;
|
|
use Filament\Tables;
|
|
use Filament\Tables\Table;
|
|
use Filament\Tables\Table;
|
|
use Filament\Widgets\TableWidget as BaseWidget;
|
|
use Filament\Widgets\TableWidget as BaseWidget;
|
|
@@ -21,7 +23,7 @@ class Websites extends BaseWidget
|
|
{
|
|
{
|
|
return $table
|
|
return $table
|
|
->query(
|
|
->query(
|
|
- Domain::query()
|
|
|
|
|
|
+ HostingSubscription::query()
|
|
)
|
|
)
|
|
->actions([
|
|
->actions([
|
|
Tables\Actions\Action::make('visit')
|
|
Tables\Actions\Action::make('visit')
|
|
@@ -31,6 +33,22 @@ class Websites extends BaseWidget
|
|
->url(fn ($record): string => 'http://'.$record->domain, true),
|
|
->url(fn ($record): string => 'http://'.$record->domain, true),
|
|
])
|
|
])
|
|
->columns([
|
|
->columns([
|
|
|
|
+
|
|
|
|
+ Tables\Columns\TextColumn::make('phyre_server_id')
|
|
|
|
+ ->label('Server')
|
|
|
|
+ ->badge()
|
|
|
|
+ ->state(function ($record) {
|
|
|
|
+ if ($record->phyre_server_id > 0) {
|
|
|
|
+ $phyreServer = PhyreServer::where('id', $record->phyre_server_id)->first();
|
|
|
|
+ if ($phyreServer) {
|
|
|
|
+ return $phyreServer->name;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return 'MAIN';
|
|
|
|
+ })
|
|
|
|
+ ->searchable()
|
|
|
|
+ ->sortable(),
|
|
|
|
+
|
|
Tables\Columns\TextColumn::make('domain'),
|
|
Tables\Columns\TextColumn::make('domain'),
|
|
// Tables\Columns\TextColumn::make('hostingPlan.name'),
|
|
// Tables\Columns\TextColumn::make('hostingPlan.name'),
|
|
Tables\Columns\TextColumn::make('created_at'),
|
|
Tables\Columns\TextColumn::make('created_at'),
|