Deploy Ladill POS / deploy (push) Successful in 35s
Builds on Phase 1 with the menu structure restaurants need: - Menu setup page (restaurant mode): categories, kitchen stations, and modifier groups with options (price deltas). - Products gain category, kitchen station, default course, and attached modifier groups (managed on the product form). - Ordering: the ticket groups the catalog by category and, when a product has modifier groups, opens a picker (respects min/max select) for options + notes + course before adding. Effective price = base + modifier deltas (resolved server-side; client prices are never trusted). - Fire-by-course: send the whole tab or just one course to the kitchen. - KDS: filter by station; each item shows its station, course, modifiers and notes. Schema additive (pos_categories, pos_stations, pos_modifier_groups, pos_modifiers, product↔group pivot, pos_sale_line_modifiers; category/station/course columns on products and lines). PosRestaurantTest covers modifiers, course and station routing; suite green (11 passed). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
34 lines
958 B
PHP
34 lines
958 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class PosModifierGroup extends Model
|
|
{
|
|
protected $fillable = ['owner_ref', 'name', 'min_select', 'max_select', 'position'];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return ['min_select' => 'integer', 'max_select' => 'integer'];
|
|
}
|
|
|
|
public function modifiers(): HasMany
|
|
{
|
|
return $this->hasMany(PosModifier::class, 'modifier_group_id')->orderBy('position')->orderBy('id');
|
|
}
|
|
|
|
public function products(): BelongsToMany
|
|
{
|
|
return $this->belongsToMany(PosProduct::class, 'pos_product_modifier_group', 'modifier_group_id', 'product_id');
|
|
}
|
|
|
|
public function scopeOwned(Builder $query, string $ownerRef): Builder
|
|
{
|
|
return $query->where('owner_ref', $ownerRef);
|
|
}
|
|
}
|