Deploy Ladill POS / deploy (push) Successful in 30s
Gated by a per-location service_style (retail | restaurant). Restaurant mode adds: - Floor screen with tables (areas, seats, status) — tap a free table to open a dine-in tab; takeaway/counter orders open from the same screen. - Open tickets (tabs): a sale stays pending while items are added; lines persist as you go (posTicket Alpine component posts each change to the server). - Send-to-kitchen fires un-sent lines; a polling Kitchen Display (KDS) shows active tickets and bumps items queued → preparing → ready → served. - Settlement reuses the existing cash / Ladill Pay flow; paying closes the tab and frees the table (PosSaleService::closeTicket, wired into both pay paths). - Settings gains the mode toggle and a tables manager. Schema is additive (new pos_tables; service_style on locations; order/kitchen columns on sales + lines). Retail flow is untouched. Sidebar surfaces Floor + Kitchen only in restaurant mode. New PosRestaurantTest covers the dine-in lifecycle end to end; suite green (10 passed). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
46 lines
1.2 KiB
PHP
46 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Pos;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Controllers\Pos\Concerns\ScopesToAccount;
|
|
use App\Models\PosSale;
|
|
use App\Models\PosTable;
|
|
use App\Services\Pos\PosLocationService;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\View\View;
|
|
|
|
class TableController extends Controller
|
|
{
|
|
use ScopesToAccount;
|
|
|
|
public function __construct(private PosLocationService $locations) {}
|
|
|
|
public function index(Request $request): View
|
|
{
|
|
$owner = $this->ownerRef($request);
|
|
$location = $this->locations->ensureDefault($owner);
|
|
|
|
$tables = PosTable::owned($owner)
|
|
->with('currentSale')
|
|
->orderBy('area')
|
|
->orderBy('position')
|
|
->orderBy('label')
|
|
->get();
|
|
|
|
$openTickets = PosSale::owned($owner)
|
|
->openTickets()
|
|
->with('table')
|
|
->withCount('lines')
|
|
->latest('opened_at')
|
|
->get();
|
|
|
|
return view('pos.floor', [
|
|
'location' => $location,
|
|
'tables' => $tables,
|
|
'tablesByArea' => $tables->groupBy(fn (PosTable $t) => $t->area ?: 'Floor'),
|
|
'openTickets' => $openTickets,
|
|
]);
|
|
}
|
|
}
|