Add all files
This commit is contained in:
40
app/Admin/Resources/UserResource/Pages/ShowServices.php
Normal file
40
app/Admin/Resources/UserResource/Pages/ShowServices.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?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])),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user