up
This commit is contained in:
+44
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\InventarioPrendaResource\RelationManagers;
|
||||
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Tables;
|
||||
use Filament\Forms;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class DistribucionesRelationManager extends RelationManager
|
||||
{
|
||||
protected static string $relationship = 'distribuciones';
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'id';
|
||||
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form->schema([
|
||||
Forms\Components\Select::make('bodega_id')->relationship('bodega', 'nombre')->required(),
|
||||
Forms\Components\Select::make('color_id')->relationship('color', 'nombre')->nullable(),
|
||||
Forms\Components\Select::make('size_id')->relationship('size', 'nombre')->nullable(),
|
||||
Forms\Components\TextInput::make('cantidad')->numeric()->required()->minValue(1),
|
||||
]);
|
||||
}
|
||||
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table->columns([
|
||||
Tables\Columns\TextColumn::make('bodega.nombre')->label('Bodega'),
|
||||
Tables\Columns\TextColumn::make('color.nombre')->label('Color'),
|
||||
Tables\Columns\TextColumn::make('size.nombre')->label('Talla'),
|
||||
Tables\Columns\TextColumn::make('cantidad'),
|
||||
Tables\Columns\TextColumn::make('created_at')->label('Creado')->dateTime(),
|
||||
])->filters([
|
||||
//
|
||||
])->headerActions([
|
||||
Tables\Actions\CreateAction::make(),
|
||||
])->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user