promotion wip

This commit is contained in:
salam committed 2025-09-28 13:34:36 +02:00
1 parent 61594777d7
commit 3c5698a550
17 files changed
+176 -303

No files matched your search

+52
View File
@@ -0,0 +1,52 @@
<?php
namespace App\Enums;
use Filament\Support\Contracts\HasDescription;
use Filament\Support\Contracts\HasIcon;
use Filament\Support\Contracts\HasLabel;
use ToneGabes\BetterOptions\Contracts\HasExtraText;
use ToneGabes\Filament\Icons\Enums\Phosphor;
enum Plan: string implements HasDescription, HasExtraText, HasIcon, HasLabel
{
case Standard = 'standard';
case Smart = 'smart';
case Premium = 'premium';
public function getDescription(): string
{
return match ($this) {
self::Standard => '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',
};
}
}
-60
View File
@@ -1,60 +0,0 @@
<?php
namespace App\Enums;
use Filament\Support\Contracts\HasDescription;
use Filament\Support\Contracts\HasIcon;
use Filament\Support\Contracts\HasLabel;
use ToneGabes\BetterOptions\Contracts\HasExtraText;
enum Zahlungen: string implements HasDescription, HasExtraText, HasIcon, HasLabel
{
case gutachten = 'gutachten';
case monat = 'monat';
case jahr = 'jahr';
public function getIcon(): string
{
return match ($this) {
self::gutachten => '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',
};
}
}
@@ -2,15 +2,15 @@
namespace App\Filament\Resources\Kontos\Schemas; namespace App\Filament\Resources\Kontos\Schemas;
use Alkoumi\FilamentImageRadioButton\Forms\Components\ImageRadioGroup;
use App\Models\Konto; use App\Models\Konto;
use App\Models\Plan;
use Danielebarbaro\LaravelVatEuValidator\Rules\VatNumber; use Danielebarbaro\LaravelVatEuValidator\Rules\VatNumber;
use Filament\Forms\Components\Select; use Filament\Forms\Components\Select;
use Filament\Forms\Components\Textarea; use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput; use Filament\Forms\Components\TextInput;
use Filament\Schemas\Components\Section; use Filament\Schemas\Components\Section;
use Filament\Schemas\Schema; use Filament\Schemas\Schema;
use ToneGabes\BetterOptions\Forms\Components\RadioCards;
use ToneGabes\Filament\Icons\Enums\Phosphor;
use Ysfkaya\FilamentPhoneInput\Forms\PhoneInput; use Ysfkaya\FilamentPhoneInput\Forms\PhoneInput;
class KontoForm class KontoForm
@@ -19,24 +19,13 @@ class KontoForm
{ {
return $schema return $schema
->components([ ->components([
RadioCards::make('plan_id') ImageRadioGroup::make('plan_id')
->label('Zahlungsplan') ->animation(true)
->columns(3) ->disk('public')
->options([ ->label('Plan')
1 => 'Einsteiger ', ->required()
2 => 'Gelegentlich', ->columnSpanFull()
3 => 'Viel in Verwendung', ->options(fn () => Plan::pluck('file', 'id')->toArray()),
])
->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(),
Section::make('Firma') Section::make('Firma')
->inlineLabel() ->inlineLabel()
->schema([ ->schema([
@@ -41,8 +41,10 @@ class KontosTable
]) ])
->recordActions([ ->recordActions([
EditAction::make(), EditAction::make()->label('')->color('gray'),
Action::make('Laden') Action::make('Laden')
->label('')
->color('gray')
->icon('heroicon-o-credit-card') ->icon('heroicon-o-credit-card')
->schema([ ->schema([
TextInput::make('subject')->required(), TextInput::make('subject')->required(),
@@ -15,8 +15,10 @@ class PlanForm
TextInput::make('name')->required(), TextInput::make('name')->required(),
TextInput::make('payment')->label('Zahlung')->required(), TextInput::make('payment')->label('Zahlung')->required(),
Textarea::make('description')->label('Beschreibung')->required(), Textarea::make('description')->label('Beschreibung')->required(),
TextInput::make('number_user')->required()->label('Anzahl Benutzer')->numeric(), TextInput::make('limit_user')->required()->label('Anzahl Benutzer')->numeric(),
TextInput::make('number_gutachter')->required()->label('Anzahl Gutachter')->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); ])->inlineLabel()->columns(1);
} }
} }
@@ -12,11 +12,14 @@ class PlansTable
{ {
return $table return $table
->columns([ ->columns([
TextColumn::make('name'), TextColumn::make('name')
TextColumn::make('payment')->label('Zahlungsart'), ->description(fn ($record): string => $record->description)
TextColumn::make('gutachten')->badge()->label('Anzahl'), ->wrap(),
TextColumn::make('number_user')->label('Benutzer')->badge(), TextColumn::make('payment')->label('Plan'),
TextColumn::make('number_gutachter')->label('Gutachter')->badge(), 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'), TextColumn::make('preis')->money('EUR'),
]) ])
->recordActions([ ->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
+1 -1
View File
@@ -11,6 +11,7 @@
"require": { "require": {
"php": "^8.3", "php": "^8.3",
"agencetwogether/hookshelper": "^0.0.2", "agencetwogether/hookshelper": "^0.0.2",
"alkoumi/filament-image-radio-button": "^1.1",
"awcodes/light-switch": "^2.0", "awcodes/light-switch": "^2.0",
"bezhansalleh/filament-shield": "*", "bezhansalleh/filament-shield": "*",
"danielebarbaro/laravel-vat-eu-validator": "^2.0", "danielebarbaro/laravel-vat-eu-validator": "^2.0",
@@ -21,7 +22,6 @@
"mallardduck/blade-lucide-icons": "^1.23", "mallardduck/blade-lucide-icons": "^1.23",
"spatie/laravel-login-link": "^1.6", "spatie/laravel-login-link": "^1.6",
"swisnl/filament-backgrounds": "^2.0", "swisnl/filament-backgrounds": "^2.0",
"tonegabes/filament-better-options": "^1.2",
"ysfkaya/filament-phone-input": "^4.0" "ysfkaya/filament-phone-input": "^4.0"
}, },
"require-dev": { "require-dev": {
Generated
+75 -202
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "295b192545f1bb63f1c99e66b0c6d815", "content-hash": "fe30cc68d11a563e43d6f90831ac7b29",
"packages": [ "packages": [
{ {
"name": "agencetwogether/hookshelper", "name": "agencetwogether/hookshelper",
@@ -79,6 +79,80 @@
], ],
"time": "2025-06-16T20:05:22+00:00" "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", "name": "anourvalar/eloquent-serialize",
"version": "1.3.4", "version": "1.3.4",
@@ -828,77 +902,6 @@
], ],
"time": "2024-07-16T11:13:48+00:00" "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", "name": "danharrin/date-format-converter",
"version": "v0.3.1", "version": "v0.3.1",
@@ -8851,136 +8854,6 @@
}, },
"time": "2024-12-21T16:25:41+00:00" "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", "name": "ueberdosis/tiptap-php",
"version": "2.0.0", "version": "2.0.0",
@@ -22,10 +22,10 @@ return new class extends Migration
$table->string('country')->nullable(); $table->string('country')->nullable();
$table->string('phone')->nullable(); $table->string('phone')->nullable();
$table->string('uid_number')->nullable(); $table->string('uid_number')->nullable();
$table->string('plan_id')->default(1);
$table->string('guthaben')->default(0); $table->string('guthaben')->default(0);
$table->timestamp('gueltig_bis')->nullable();
$table->string('abgeschlossen')->default(1); $table->string('abgeschlossen')->default(1);
$table->integer('plan_id')->default(1);
$table->timestamp('gueltig_bis')->nullable();
$table->timestamps(); $table->timestamps();
}); });
} }
@@ -15,10 +15,13 @@ return new class extends Migration
$table->id(); $table->id();
$table->string('name')->nullable(); $table->string('name')->nullable();
$table->string('payment')->nullable(); $table->string('payment')->nullable();
$table->string('gutachten')->nullable(); $table->string('description')->nullable();
$table->string('file')->nullable();
$table->integer('preis')->default(0); $table->integer('preis')->default(0);
$table->integer('number_user')->default(1); $table->integer('limit_user')->default(1);
$table->integer('number_gutachter')->default(1); $table->integer('limit_auftraggeber')->default(1);
$table->integer('limit_gutachter')->default(1);
$table->integer('limit_gutachten')->nullable();
$table->timestamps(); $table->timestamps();
}); });
} }
+5 -2
View File
@@ -15,6 +15,11 @@ class DatabaseSeeder extends Seeder
*/ */
public function run(): void public function run(): void
{ {
$this->call([
OrientierungenSeeder::class,
PlansSeeder::class,
]);
if (app()->isLocal()) { if (app()->isLocal()) {
Konto::factory()->count(10)->create(); Konto::factory()->count(10)->create();
Gutachter::factory()->count(30)->create(); Gutachter::factory()->count(30)->create();
@@ -22,8 +27,6 @@ class DatabaseSeeder extends Seeder
} }
$this->call([ $this->call([
OrientierungenSeeder::class,
PlansSeeder::class,
RolesAndPermissionsSeeder::class, RolesAndPermissionsSeeder::class,
]); ]);
+4 -4
View File
@@ -12,11 +12,11 @@ class PlansSeeder extends Seeder
*/ */
public function run(): void 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 VALUES
('1', 'Einfach', 'Per Gutachten', 'Per Stück', '75', '1', '1', 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', 'Erweitert', 'Monatlich', 'Unbegrenzt', '150', '3', '1', NULL, NULL), ('2', 'Smart', 'Monatlich', 'Zahlung erfolgt monatlich, ohne Begrenzung der Gutachten.', 'promotion/smart.jpg', '150', '3', '1', '3', '-1', NULL, NULL),
('3', 'Vollversion', 'Jährlich', 'Unbegrenzt', '1750', '5', '10', 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); DB::unprepared($sql);
} }
Binary file not shown.

After

Width:  |  Height:  |  Size: 230 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

+1 -1
View File
@@ -4,7 +4,7 @@
@source '../../../../resources/views/**/*'; @source '../../../../resources/views/**/*';
@source '../../../../resources/views/filament/**/*'; @source '../../../../resources/views/filament/**/*';
@source '../../../../vendor/awcodes/light-switch/resources/**/*.blade.php'; @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 { .fi-simple-main {
@apply relative sm:max-w-3xl; @apply relative sm:max-w-3xl;