diff --git a/app/Enums/Plan.txt b/app/Enums/Plan.txt new file mode 100644 index 0000000..0215a08 --- /dev/null +++ b/app/Enums/Plan.txt @@ -0,0 +1,52 @@ + 'Zahlungen können für jedes Gutachten einzeln getätigt werden', + self::Smart => 'Zahlung erfolgt monatlich, ohne Begrenzung für die erstellten Gutachten', + self::Premium => 'Zahlung erfolgt jährlich, ohne Begrenzung für die erstellten Gutachten, Gutachter oder Auftraggeber', + }; + } + + public function getExtraText(): string + { + return match ($this) { + self::Standard => 'model.standard', + self::Smart => 'model.smart', + self::Premium => 'model.premium', + }; + } + + public function getIcon(): string + { + return match ($this) { + self::Standard => Phosphor::Airplane->thin(), + self::Smart => Phosphor::AirplaneTakeoff->thin(), + self::Premium => Phosphor::AirplaneInFlight->thin(), + }; + } + + public function getLabel(): ?string + { + return match ($this) { + self::Standard => 'Per Gutachten', + self::Smart => 'Monatlich', + self::Premium => 'Jährlich', + }; + } +} diff --git a/app/Enums/Zahlungen.php b/app/Enums/Zahlungen.php deleted file mode 100644 index 94e8229..0000000 --- a/app/Enums/Zahlungen.php +++ /dev/null @@ -1,60 +0,0 @@ - 'licude-credit-card', - self::monat => 'licude-credit-card', - self::jahr => 'licude-credit-card', - }; - } - - public function getLabel(): ?string - { - return match ($this) { - self::gutachten => 'Zahlung pro Gutachten', - self::monat => 'Zahlung Monatlich', - self::jahr => 'Zahlung Jährlich', - }; - } - - public function getExtraText(): string - { - return match ($this) { - self::gutachten => 'Zahlung pro Gutachten', - self::monat => 'Zahlung Monatlich', - self::jahr => 'Zahlung Jährlich', - }; - } - - public function getDescription(): ?string - { - return match ($this) { - self::gutachten => 'Zahlungen können für jedes Gutachten einzeln getätigt werden', - self::monat => 'Zahlung erfolgt monatlich, ohne Begrenzung für die erstellten Gutachten', - self::jahr => 'Zahlung erfolgt jährlich, ohne Begrenzung für die erstellten Gutachten, Gutachter oder Auftraggeber', - }; - } - - public function getIcons(): ?string - { - return match ($this) { - self::gutachten => 'licude-battery-low', - self::monat => 'licude-battery-medium', - self::jahr => 'licude-battery-full', - }; - } -} diff --git a/app/Filament/Resources/Kontos/Schemas/KontoForm.php b/app/Filament/Resources/Kontos/Schemas/KontoForm.php index 0337ee6..8aa5e05 100644 --- a/app/Filament/Resources/Kontos/Schemas/KontoForm.php +++ b/app/Filament/Resources/Kontos/Schemas/KontoForm.php @@ -2,15 +2,15 @@ namespace App\Filament\Resources\Kontos\Schemas; +use Alkoumi\FilamentImageRadioButton\Forms\Components\ImageRadioGroup; use App\Models\Konto; +use App\Models\Plan; use Danielebarbaro\LaravelVatEuValidator\Rules\VatNumber; use Filament\Forms\Components\Select; use Filament\Forms\Components\Textarea; use Filament\Forms\Components\TextInput; use Filament\Schemas\Components\Section; use Filament\Schemas\Schema; -use ToneGabes\BetterOptions\Forms\Components\RadioCards; -use ToneGabes\Filament\Icons\Enums\Phosphor; use Ysfkaya\FilamentPhoneInput\Forms\PhoneInput; class KontoForm @@ -19,24 +19,13 @@ class KontoForm { return $schema ->components([ - RadioCards::make('plan_id') - ->label('Zahlungsplan') - ->columns(3) - ->options([ - 1 => 'Einsteiger ', - 2 => 'Gelegentlich', - 3 => 'Viel in Verwendung', - ]) - ->descriptions([ - 1 => 'Bezahlung bei der Erstellung eines Gutachtens.', - 2 => 'Zahlung Monatlich ohne Begrenzung der Gutachten.', - 3 => 'Zahlung Jährlich, ohne Begrenzung der Mitarbeiter, Gutachter und Auftraggeber.', - ]) - ->icons([ - 1 => Phosphor::Airplane->thin(), - 2 => Phosphor::AirplaneTakeoff->thin(), - 3 => Phosphor::AirplaneInFlight->thin(), - ])->columnSpanFull(), + ImageRadioGroup::make('plan_id') + ->animation(true) + ->disk('public') + ->label('Plan') + ->required() + ->columnSpanFull() + ->options(fn () => Plan::pluck('file', 'id')->toArray()), Section::make('Firma') ->inlineLabel() ->schema([ diff --git a/app/Filament/Resources/Kontos/Tables/KontosTable.php b/app/Filament/Resources/Kontos/Tables/KontosTable.php index 8ef5024..efe56e8 100644 --- a/app/Filament/Resources/Kontos/Tables/KontosTable.php +++ b/app/Filament/Resources/Kontos/Tables/KontosTable.php @@ -41,8 +41,10 @@ class KontosTable ]) ->recordActions([ - EditAction::make(), + EditAction::make()->label('')->color('gray'), Action::make('Laden') + ->label('') + ->color('gray') ->icon('heroicon-o-credit-card') ->schema([ TextInput::make('subject')->required(), diff --git a/app/Filament/Resources/Plans/Schemas/PlanForm.php b/app/Filament/Resources/Plans/Schemas/PlanForm.php index 1f860c1..abf42cb 100644 --- a/app/Filament/Resources/Plans/Schemas/PlanForm.php +++ b/app/Filament/Resources/Plans/Schemas/PlanForm.php @@ -15,8 +15,10 @@ class PlanForm TextInput::make('name')->required(), TextInput::make('payment')->label('Zahlung')->required(), Textarea::make('description')->label('Beschreibung')->required(), - TextInput::make('number_user')->required()->label('Anzahl Benutzer')->numeric(), - TextInput::make('number_gutachter')->required()->label('Anzahl Gutachter')->numeric(), + TextInput::make('limit_user')->required()->label('Anzahl Benutzer')->numeric(), + TextInput::make('limit_auftraggeber')->required()->label('Anzahl Auftraggeber')->numeric(), + TextInput::make('limit_gutachter')->required()->label('Anzahl Gutachter')->numeric(), + TextInput::make('limit_gutachten')->required()->label('Anzahl Projekte')->numeric(), ])->inlineLabel()->columns(1); } } diff --git a/app/Filament/Resources/Plans/Tables/PlansTable.php b/app/Filament/Resources/Plans/Tables/PlansTable.php index b54864a..1245f8f 100644 --- a/app/Filament/Resources/Plans/Tables/PlansTable.php +++ b/app/Filament/Resources/Plans/Tables/PlansTable.php @@ -12,11 +12,14 @@ class PlansTable { return $table ->columns([ - TextColumn::make('name'), - TextColumn::make('payment')->label('Zahlungsart'), - TextColumn::make('gutachten')->badge()->label('Anzahl'), - TextColumn::make('number_user')->label('Benutzer')->badge(), - TextColumn::make('number_gutachter')->label('Gutachter')->badge(), + TextColumn::make('name') + ->description(fn ($record): string => $record->description) + ->wrap(), + TextColumn::make('payment')->label('Plan'), + TextColumn::make('limit_user')->label('B')->tooltip('Benutzer')->badge(), + TextColumn::make('limit_auftraggeber')->label('A')->tooltip('Auftraggeber')->badge(), + TextColumn::make('limit_gutachter')->label('G')->tooltip('Gutachter')->badge(), + TextColumn::make('limit_gutachten')->label('P')->tooltip('Projekte')->badge(), TextColumn::make('preis')->money('EUR'), ]) ->recordActions([ @@ -24,3 +27,9 @@ class PlansTable ]); } } +// `file` varchar(255) DEFAULT NULL, +// `preis` int(11) NOT NULL DEFAULT 0, +// `limit_user` int(11) NOT NULL DEFAULT 1, +// `limit_auftraggeber` int(11) NOT NULL DEFAULT 1, +// `limit_gutachter` int(11) NOT NULL DEFAULT 1, +// `limit_gutachten` int(11) D diff --git a/composer.json b/composer.json index e724627..814a714 100644 --- a/composer.json +++ b/composer.json @@ -11,6 +11,7 @@ "require": { "php": "^8.3", "agencetwogether/hookshelper": "^0.0.2", + "alkoumi/filament-image-radio-button": "^1.1", "awcodes/light-switch": "^2.0", "bezhansalleh/filament-shield": "*", "danielebarbaro/laravel-vat-eu-validator": "^2.0", @@ -21,7 +22,6 @@ "mallardduck/blade-lucide-icons": "^1.23", "spatie/laravel-login-link": "^1.6", "swisnl/filament-backgrounds": "^2.0", - "tonegabes/filament-better-options": "^1.2", "ysfkaya/filament-phone-input": "^4.0" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 47dd5f4..cf7fc98 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "295b192545f1bb63f1c99e66b0c6d815", + "content-hash": "fe30cc68d11a563e43d6f90831ac7b29", "packages": [ { "name": "agencetwogether/hookshelper", @@ -79,6 +79,80 @@ ], "time": "2025-06-16T20:05:22+00:00" }, + { + "name": "alkoumi/filament-image-radio-button", + "version": "v1.1.7", + "source": { + "type": "git", + "url": "https://github.com/alkoumi/filament-image-radio-button.git", + "reference": "a8e91551adb1725a9219ae7c379a8474e7b4638f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/alkoumi/filament-image-radio-button/zipball/a8e91551adb1725a9219ae7c379a8474e7b4638f", + "reference": "a8e91551adb1725a9219ae7c379a8474e7b4638f", + "shasum": "" + }, + "require": { + "filament/filament": "^3.0|^4.0", + "php": "^8.1|^8.2|^8.3|^8.4", + "spatie/laravel-package-tools": "^1.15.0" + }, + "require-dev": { + "filament/upgrade": "^4.0", + "nunomaduro/collision": "*", + "orchestra/testbench": "^10.6" + }, + "type": "library", + "extra": { + "laravel": { + "aliases": { + "FilamentImageRadioButton": "Alkoumi\\FilamentImageRadioButton\\Facades\\FilamentImageRadioButton" + }, + "providers": [ + "Alkoumi\\FilamentImageRadioButton\\FilamentImageRadioButtonServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Alkoumi\\FilamentImageRadioButton\\": "src/", + "Alkoumi\\FilamentImageRadioButton\\Database\\Factories\\": "database/factories/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mohamed alkoumi", + "email": "mohammedelkoumi@gmail.com", + "role": "Developer" + } + ], + "description": "Filament Form Radio Button But With Images", + "homepage": "https://github.com/alkoumi/filament-image-radio-button", + "keywords": [ + "alkoumi", + "filament", + "filament-image-radio-button", + "image-radio-button", + "image-select", + "laravel" + ], + "support": { + "issues": "https://github.com/alkoumi/filament-image-radio-button/issues", + "source": "https://github.com/alkoumi/filament-image-radio-button" + }, + "funding": [ + { + "url": "https://github.com/alkoumi", + "type": "github" + } + ], + "time": "2025-08-27T14:45:42+00:00" + }, { "name": "anourvalar/eloquent-serialize", "version": "1.3.4", @@ -828,77 +902,6 @@ ], "time": "2024-07-16T11:13:48+00:00" }, - { - "name": "codeat3/blade-phosphor-icons", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/codeat3/blade-phosphor-icons.git", - "reference": "2812a27ec642359344429d344c7f7bbdfad489ce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/codeat3/blade-phosphor-icons/zipball/2812a27ec642359344429d344c7f7bbdfad489ce", - "reference": "2812a27ec642359344429d344c7f7bbdfad489ce", - "shasum": "" - }, - "require": { - "blade-ui-kit/blade-icons": "^1.1", - "illuminate/support": "^8.0|^9.0|^10.0|^11.0|^12.0", - "php": "^7.4|^8.0" - }, - "require-dev": { - "codeat3/blade-icon-generation-helpers": "^0.10", - "codeat3/phpcs-styles": "^1.0", - "orchestra/testbench": "^6.0|^7.0|^8.0|^9.0|^10.0", - "phpunit/phpunit": "^9.0|^10.5|^11.0" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Codeat3\\BladePhosphorIcons\\BladePhosphorIconsServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Codeat3\\BladePhosphorIcons\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Swapnil Sarwe", - "homepage": "https://swapnilsarwe.com" - }, - { - "name": "Dries Vints", - "homepage": "https://driesvints.com" - } - ], - "description": "A package to easily make use of \"Phosphor Icons\" in your Laravel Blade views.", - "homepage": "https://github.com/codeat3/blade-phosphor-icons", - "keywords": [ - "blade", - "laravel", - "phosphor-icons" - ], - "support": { - "issues": "https://github.com/codeat3/blade-phosphor-icons/issues", - "source": "https://github.com/codeat3/blade-phosphor-icons/tree/2.3.0" - }, - "funding": [ - { - "url": "https://github.com/swapnilsarwe", - "type": "github" - } - ], - "time": "2025-02-25T06:29:09+00:00" - }, { "name": "danharrin/date-format-converter", "version": "v0.3.1", @@ -8851,136 +8854,6 @@ }, "time": "2024-12-21T16:25:41+00:00" }, - { - "name": "tonegabes/filament-better-options", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/tonegabes/filament-better-options.git", - "reference": "20f267fe817f9b80bcdcee27c072f47f88499c21" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/tonegabes/filament-better-options/zipball/20f267fe817f9b80bcdcee27c072f47f88499c21", - "reference": "20f267fe817f9b80bcdcee27c072f47f88499c21", - "shasum": "" - }, - "require": { - "filament/forms": "^4.0", - "php": "^8.3", - "spatie/laravel-package-tools": "^1.15.0", - "tonegabes/filament-phosphor-icons": "^1.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.86", - "larastan/larastan": "^3.0", - "laravel/pint": "^1.0", - "phpstan/phpstan-deprecation-rules": "^2.0" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "ToneGabes\\BetterOptions\\BetterOptionsServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "ToneGabes\\BetterOptions\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Tone Gabes", - "email": "tonegabes@gmail.com", - "homepage": "https://tonegabes.com", - "role": "Developer" - } - ], - "description": "Filament form components for better radio and checkbox options.", - "homepage": "https://github.com/tonegabes/filament-better-options", - "keywords": [ - "Forms", - "checkbox", - "filament", - "laravel", - "php", - "plugin", - "tonegabes" - ], - "support": { - "issues": "https://github.com/tonegabes/filament-better-options/issues", - "source": "https://github.com/tonegabes/filament-better-options" - }, - "time": "2025-09-25T17:26:15+00:00" - }, - { - "name": "tonegabes/filament-phosphor-icons", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/tonegabes/filament-phosphor-icons.git", - "reference": "f654722dee534ccddd005e667a73e8e64cb412cc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/tonegabes/filament-phosphor-icons/zipball/f654722dee534ccddd005e667a73e8e64cb412cc", - "reference": "f654722dee534ccddd005e667a73e8e64cb412cc", - "shasum": "" - }, - "require": { - "codeat3/blade-phosphor-icons": "^2.3", - "filament/filament": "^4.0", - "php": "^8.1" - }, - "require-dev": { - "laravel/pint": "^1.22" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "ToneGabes\\Filament\\Icons\\PhosphorIconsServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "ToneGabes\\Filament\\Icons\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Tone Gabes", - "email": "tonegabes@gmail.com", - "homepage": "https://tonegabes.com", - "role": "Developer" - } - ], - "description": "Phosphor Icons Pack ready for Filament 4", - "keywords": [ - "Iconset", - "Phosphor", - "filament", - "icons", - "laravel", - "library" - ], - "support": { - "issues": "https://github.com/tonegabes/filament-phosphor-icons/issues", - "source": "https://github.com/tonegabes/filament-phosphor-icons/tree/1.2.1" - }, - "time": "2025-09-12T18:24:34+00:00" - }, { "name": "ueberdosis/tiptap-php", "version": "2.0.0", diff --git a/database/migrations/0001_01_01_000000__create_kontos_table.php b/database/migrations/0001_01_01_000000__create_kontos_table.php index 83c5d43..d398024 100644 --- a/database/migrations/0001_01_01_000000__create_kontos_table.php +++ b/database/migrations/0001_01_01_000000__create_kontos_table.php @@ -22,10 +22,10 @@ return new class extends Migration $table->string('country')->nullable(); $table->string('phone')->nullable(); $table->string('uid_number')->nullable(); - $table->string('plan_id')->default(1); $table->string('guthaben')->default(0); - $table->timestamp('gueltig_bis')->nullable(); $table->string('abgeschlossen')->default(1); + $table->integer('plan_id')->default(1); + $table->timestamp('gueltig_bis')->nullable(); $table->timestamps(); }); } diff --git a/database/migrations/2025_09_06_143006_create_plan_table.php b/database/migrations/2025_09_06_143006_create_plan_table.php index 9e90453..8745fa3 100644 --- a/database/migrations/2025_09_06_143006_create_plan_table.php +++ b/database/migrations/2025_09_06_143006_create_plan_table.php @@ -15,10 +15,13 @@ return new class extends Migration $table->id(); $table->string('name')->nullable(); $table->string('payment')->nullable(); - $table->string('gutachten')->nullable(); + $table->string('description')->nullable(); + $table->string('file')->nullable(); $table->integer('preis')->default(0); - $table->integer('number_user')->default(1); - $table->integer('number_gutachter')->default(1); + $table->integer('limit_user')->default(1); + $table->integer('limit_auftraggeber')->default(1); + $table->integer('limit_gutachter')->default(1); + $table->integer('limit_gutachten')->nullable(); $table->timestamps(); }); } diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index bb6f857..6b59392 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -15,6 +15,11 @@ class DatabaseSeeder extends Seeder */ public function run(): void { + $this->call([ + OrientierungenSeeder::class, + PlansSeeder::class, + ]); + if (app()->isLocal()) { Konto::factory()->count(10)->create(); Gutachter::factory()->count(30)->create(); @@ -22,8 +27,6 @@ class DatabaseSeeder extends Seeder } $this->call([ - OrientierungenSeeder::class, - PlansSeeder::class, RolesAndPermissionsSeeder::class, ]); diff --git a/database/seeders/PlansSeeder.php b/database/seeders/PlansSeeder.php index 34921e0..0e91076 100644 --- a/database/seeders/PlansSeeder.php +++ b/database/seeders/PlansSeeder.php @@ -12,11 +12,11 @@ class PlansSeeder extends Seeder */ public function run(): void { - $sql = "INSERT INTO `plans` (`id`, `name`, `payment`, `gutachten`, `preis`, `number_user`, `number_gutachter`, `created_at`, `updated_at`) + $sql = "INSERT INTO `plans` (`id`, `name`, `payment`, `description`, `file`, `preis`, `limit_user`, `limit_auftraggeber`, `limit_gutachter`, `limit_gutachten`, `created_at`, `updated_at`) VALUES - ('1', 'Einfach', 'Per Gutachten', 'Per Stück', '75', '1', '1', NULL, NULL), - ('2', 'Erweitert', 'Monatlich', 'Unbegrenzt', '150', '3', '1', NULL, NULL), - ('3', 'Vollversion', 'Jährlich', 'Unbegrenzt', '1750', '5', '10', NULL, NULL); + ('1', 'Standard', 'Per Gutachten', 'Zahlungen werden für jedes Gutachten einzeln getätigt.', 'promotion/basic.jpg', '75', '1', '1', '1', '1', NULL, NULL), + ('2', 'Smart', 'Monatlich', 'Zahlung erfolgt monatlich, ohne Begrenzung der Gutachten.', 'promotion/smart.jpg', '150', '3', '1', '3', '-1', NULL, NULL), + ('3', 'Premium', 'Jährlich', 'Zahlung erfolgt jährlich, ohne Begrenzung für Gutachten, Gutachter oder Auftraggeber.', 'promotion/premium.jpg', '1750', '10', '5', '5', '-1', NULL, NULL); "; DB::unprepared($sql); } diff --git a/public/images/promotion/basic.jpg b/public/images/promotion/basic.jpg new file mode 100644 index 0000000..4e8de8a Binary files /dev/null and b/public/images/promotion/basic.jpg differ diff --git a/public/images/promotion/premium.jpg b/public/images/promotion/premium.jpg new file mode 100644 index 0000000..4c82fe5 Binary files /dev/null and b/public/images/promotion/premium.jpg differ diff --git a/public/images/promotion/promotions.afphoto b/public/images/promotion/promotions.afphoto new file mode 100644 index 0000000..eceef29 Binary files /dev/null and b/public/images/promotion/promotions.afphoto differ diff --git a/public/images/promotion/smart.jpg b/public/images/promotion/smart.jpg new file mode 100644 index 0000000..17e0b17 Binary files /dev/null and b/public/images/promotion/smart.jpg differ diff --git a/resources/css/filament/admin/theme.css b/resources/css/filament/admin/theme.css index 388ffee..a9e1639 100644 --- a/resources/css/filament/admin/theme.css +++ b/resources/css/filament/admin/theme.css @@ -4,7 +4,7 @@ @source '../../../../resources/views/**/*'; @source '../../../../resources/views/filament/**/*'; @source '../../../../vendor/awcodes/light-switch/resources/**/*.blade.php'; -@source '../../../../vendor/jaocero/radio-deck/resources/views'; +@source '../../../../vendor/alkoumi/filament-image-radio-button/resources/views/**/*.blade.php'; .fi-simple-main { @apply relative sm:max-w-3xl;