This commit is contained in:
salam committed 2025-10-31 15:38:20 +01:00
1 parent 30563ee98d
commit 622b37bb90
12 files changed
+56 -56

No files matched your search

@@ -2,7 +2,7 @@
namespace App\Filament\Resources\Projektes\Widgets;
use App\Models\Merkmale;
use App\Models\ProjektMerkmale;
use App\Models\ProjektObjekte;
use Filament\Actions\Action;
use Filament\Actions\DeleteAction;
@@ -13,11 +13,11 @@ use Filament\Tables\Table;
use Filament\Widgets\TableWidget;
use Illuminate\Database\Eloquent\Builder;
class WidgetMerkmale extends TableWidget
class WidgetProjektMerkmale extends TableWidget
{
protected static ?string $navigationLabel = 'Merkmal';
protected static ?string $pluralModelLabel = 'Merkmale';
protected static ?string $pluralModelLabel = 'ProjektMerkmale';
protected static ?string $modelLabel = 'Merkmal';
@@ -29,7 +29,7 @@ class WidgetMerkmale extends TableWidget
{
return $table
->striped()
->query(fn (): Builder => Merkmale::where('projekte_id', $this->projekte_id))
->query(fn (): Builder => ProjektMerkmale::where('projekte_id', $this->projekte_id))
->defaultSort('code')
->columns([
TextColumn::make('name'),
@@ -73,9 +73,9 @@ class WidgetMerkmale extends TableWidget
->prefixIcon('phosphor-house-simple'),
])
->action(function (array $data) {
$code = Merkmale::getfreecode($this->projekte_id);
$code = ProjektMerkmale::getfreecode($this->projekte_id);
if ($code) {
$merkmal = new Merkmale;
$merkmal = new ProjektMerkmale;
$merkmal->projekte_id = $this->projekte_id;
$merkmal->code = $code;
$merkmal->name = $data['name'];