Add retail/restaurant mode toggle to the register
Deploy Ladill POS / deploy (push) Successful in 45s

A segmented Retail | Restaurant control in the register header flips the
location's service_style in place (RegisterController@setMode → pos.mode.set).
Switching to restaurant lands on the Floor and reveals Floor/Kitchen/Menu in the
sidebar; switching to retail stays on the register. Covered by PosRestaurantTest.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
isaacclad
2026-06-25 12:03:46 +00:00
co-authored by Claude Opus 4.8
parent 1bbc9490f1
commit 0d816daed3
4 changed files with 47 additions and 0 deletions
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Pos;
use App\Http\Controllers\Controller;
use App\Http\Controllers\Pos\Concerns\ScopesToAccount;
use App\Models\PosLocation;
use App\Models\PosProduct;
use App\Models\PosSale;
use App\Services\Pos\PosLocationService;
@@ -37,6 +38,21 @@ class RegisterController extends Controller
]);
}
/** Quick switch between retail and restaurant service from the register. */
public function setMode(Request $request): RedirectResponse
{
$data = $request->validate(['style' => ['required', 'in:retail,restaurant']]);
$location = $this->locations->ensureDefault($this->ownerRef($request));
$location->update(['service_style' => $data['style']]);
if ($data['style'] === PosLocation::STYLE_RESTAURANT) {
return redirect()->route('pos.floor')->with('success', 'Restaurant mode on — Floor, Kitchen & Menu are now in the sidebar.');
}
return redirect()->route('pos.register')->with('success', 'Retail mode on.');
}
/** @return list<array<string, mixed>> */
private function crmCustomers(string $owner): array
{