diff --git a/app/Filament/User/Resources/SupplierResource.php b/app/Filament/User/Resources/SupplierResource.php index be27615..a79ebfc 100644 --- a/app/Filament/User/Resources/SupplierResource.php +++ b/app/Filament/User/Resources/SupplierResource.php @@ -28,8 +28,24 @@ class SupplierResource extends Resource return $form ->schema([ Forms\Components\TextInput::make('name') + ->label('Name') ->required() ->maxLength(255), + Forms\Components\TextInput::make('address') + ->label('Anschrift') + ->maxLength(255), + Forms\Components\TextInput::make('phone') + ->label('Telefon') + ->tel() + ->maxLength(50), + Forms\Components\TextInput::make('email') + ->label('E-Mail') + ->email() + ->maxLength(255), + Forms\Components\TextInput::make('website') + ->label('Webseite') + ->url() + ->maxLength(255), ]); } @@ -38,7 +54,16 @@ class SupplierResource extends Resource return $table ->columns([ Tables\Columns\TextColumn::make('name') + ->label('Name') ->searchable(), + Tables\Columns\TextColumn::make('email') + ->label('E-Mail') + ->searchable(), + Tables\Columns\TextColumn::make('phone') + ->label('Telefon'), + Tables\Columns\TextColumn::make('website') + ->label('Webseite') + ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('created_at') ->dateTime() ->sortable() diff --git a/app/Models/Supplier.php b/app/Models/Supplier.php index 4b8a6df..d903fab 100644 --- a/app/Models/Supplier.php +++ b/app/Models/Supplier.php @@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Model; class Supplier extends Model { use HasFactory; - protected $fillable = ['name']; + protected $fillable = ['name', 'address', 'phone', 'email', 'website']; public function spiceSuppliers() { diff --git a/database/migrations/2026_09_12_240000_add_contact_fields_to_suppliers.php b/database/migrations/2026_09_12_240000_add_contact_fields_to_suppliers.php new file mode 100644 index 0000000..15ce55a --- /dev/null +++ b/database/migrations/2026_09_12_240000_add_contact_fields_to_suppliers.php @@ -0,0 +1,25 @@ +string('address')->nullable()->after('name'); + $table->string('phone')->nullable()->after('address'); + $table->string('email')->nullable()->after('phone'); + $table->string('website')->nullable()->after('email'); + }); + } + + public function down(): void + { + Schema::table('suppliers', function (Blueprint $table) { + $table->dropColumn(['address', 'phone', 'email', 'website']); + }); + } +};