update
This commit is contained in:
@@ -6,17 +6,17 @@ use App\Filament\Resources\ProveedorResource\Pages;
|
||||
use App\Filament\Resources\ProveedorResource\RelationManagers;
|
||||
use App\Models\Proveedor;
|
||||
use Filament\Forms;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Tables;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
|
||||
class ProveedorResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Proveedor::class;
|
||||
protected static ?string $navigationGroup = 'Administración'; //
|
||||
|
||||
protected static ?string $navigationGroup = 'Administración'; //
|
||||
protected static ?string $navigationIcon = 'heroicon-o-users';
|
||||
|
||||
public static function canViewAny(): bool
|
||||
@@ -31,15 +31,22 @@ class ProveedorResource extends Resource
|
||||
Forms\Components\TextInput::make('nombre')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
Forms\Components\TextInput::make('contacto')
|
||||
Forms\Components\TextInput::make('nit')
|
||||
|
||||
->maxLength(255),
|
||||
Select::make('categoria')
|
||||
->label('Categoría')
|
||||
->options([
|
||||
'tintoreria' => 'Tintorería',
|
||||
'talleres' => 'Talleres',
|
||||
'telas' => 'Telas',
|
||||
'otros' => 'Otros',
|
||||
])
|
||||
->required(),
|
||||
Forms\Components\TextInput::make('telefono')
|
||||
->tel()
|
||||
->maxLength(20),
|
||||
Forms\Components\TextInput::make('correo')
|
||||
->maxLength(255),
|
||||
Forms\Components\Textarea::make('direccion')
|
||||
->columnSpanFull(),
|
||||
->maxLength(20)->required(),
|
||||
Forms\Components\Textarea::make('direccion'),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -48,28 +55,40 @@ class ProveedorResource extends Resource
|
||||
return $table
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('nombre')
|
||||
->label('Nombre')
|
||||
->searchable()
|
||||
->sortable(),
|
||||
|
||||
Tables\Columns\TextColumn::make('nit')
|
||||
->label('NIT')
|
||||
->searchable(),
|
||||
Tables\Columns\TextColumn::make('contacto')
|
||||
->searchable(),
|
||||
|
||||
Tables\Columns\BadgeColumn::make('categoria')
|
||||
->label('Categoría')
|
||||
->colors([
|
||||
'primary' => 'tintoreria',
|
||||
'success' => 'talleres',
|
||||
'warning' => 'telas',
|
||||
'gray' => 'otros',
|
||||
])
|
||||
->sortable(),
|
||||
|
||||
Tables\Columns\TextColumn::make('telefono')
|
||||
->label('Teléfono')
|
||||
->searchable(),
|
||||
Tables\Columns\TextColumn::make('correo')
|
||||
->searchable(),
|
||||
|
||||
Tables\Columns\TextColumn::make('direccion')
|
||||
->label('Dirección')
|
||||
->limit(30)
|
||||
->toggleable(),
|
||||
|
||||
Tables\Columns\TextColumn::make('created_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
Tables\Columns\TextColumn::make('updated_at')
|
||||
->label('Creado')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
])
|
||||
->paginated(true)
|
||||
//->paginationPageOptions([50])
|
||||
->defaultSort('created_at', 'desc')
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user