41 lines
1.2 KiB
PHP
41 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Admin\Resources\UserResource\Pages;
|
|
|
|
use App\Admin\Resources\ServiceResource;
|
|
use App\Admin\Resources\UserResource;
|
|
use Filament\Resources\Pages\ManageRelatedRecords;
|
|
use Filament\Tables;
|
|
use Filament\Tables\Table;
|
|
|
|
class ShowServices extends ManageRelatedRecords
|
|
{
|
|
protected static string $resource = UserResource::class;
|
|
|
|
protected static string $relationship = 'services';
|
|
|
|
protected static ?string $navigationIcon = 'heroicon-o-shopping-cart';
|
|
|
|
public static function getNavigationLabel(): string
|
|
{
|
|
return 'Products/Services';
|
|
}
|
|
|
|
public function table(Table $table): Table
|
|
{
|
|
return $table
|
|
->recordTitleAttribute('product.name')
|
|
->columns([
|
|
Tables\Columns\TextColumn::make('product.name'),
|
|
Tables\Columns\TextColumn::make('quantity'),
|
|
Tables\Columns\TextColumn::make('formattedPrice')->label('Price'),
|
|
])
|
|
->filters([
|
|
//
|
|
])
|
|
->actions([
|
|
Tables\Actions\ViewAction::make()->url(fn ($record) => ServiceResource::getUrl('edit', ['record' => $record])),
|
|
]);
|
|
}
|
|
}
|