Initial commit

This commit is contained in:
2025-10-11 17:02:49 +02:00
commit 92056f073f
243 changed files with 27536 additions and 0 deletions

View File

@@ -0,0 +1,82 @@
<?php
namespace App\Filament\Resources\Products\Schemas;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\Builder;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Select;
use Filament\Schemas\Schema;
use Filament\Schemas\Components\Section;
use Filament\Forms\Components\Builder\Block;
use App\Models\Ingredient;
class ProductForm
{
public static function configure(Schema $schema): Schema
{
return $schema
->components([
Section::make()
->schema([
TextInput::make('category')
->label('Kategoria')
->required()
->maxLength(2048),
TextInput::make('description')
->label('Opis')
->nullable()
->maxLength(2048),
]),
Section::make()
->schema([
Builder::make('products')
->label('Produkty')
->addActionLabel('Dodaj produkt')
->collapsible()
->collapsed()
->reorderable()
->blocks([
Block::make('product')
->label(function (?array $state): string {
if ($state === null) {
return 'Produkt';
}
return $state['name'] ?? 'Produkt';
})
->schema([
TextInput::make('name')
->label('Nazwa')
->required(),
Select::make('ingredients')
->label('Składniki')
->multiple()
->options(Ingredient::pluck('name', 'id'))
->searchable(),
TextInput::make('description')
->label('Opis')
->nullable(),
TextInput::make('price_small')
->label('Cena (mała)')
->numeric()
->nullable(),
TextInput::make('price_medium')
->label('Cena (średnia)')
->numeric()
->nullable(),
TextInput::make('price_large')
->label('Cena (duża)')
->numeric()
->nullable(),
TextInput::make('spicy')
->label('Ostrość')
->numeric()
->nullable(),
])
->columns(2),
]),
]),
]);
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace App\Filament\Resources\Products\Schemas;
use Filament\Infolists\Components\TextEntry;
use Filament\Schemas\Schema;
class ProductInfolist
{
public static function configure(Schema $schema): Schema
{
return $schema
->components([
//
]);
}
}