Surface branches and team as explicit settings sections.
Deploy Ladill POS / deploy (push) Successful in 37s
Deploy Ladill POS / deploy (push) Successful in 37s
Embed branch list, switching, and team invites on the main settings page; dedicated routes redirect back with anchors. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -5,6 +5,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\PosMember;
|
||||
use App\Models\PosTable;
|
||||
use App\Services\Import\CrmProductImportService;
|
||||
use App\Services\Import\MerchantCatalogImportService;
|
||||
@@ -28,9 +29,21 @@ class SettingsController extends Controller
|
||||
{
|
||||
$owner = $this->ownerRef($request);
|
||||
$location = $this->location($request);
|
||||
$account = ladill_account() ?? $request->user();
|
||||
$scope = $this->locationScope($request);
|
||||
|
||||
$branches = $scope === null
|
||||
? PosLocation::owned($owner)->orderBy('name')->get()
|
||||
: PosLocation::owned($owner)->whereKey($scope)->orderBy('name')->get();
|
||||
|
||||
return view('pos.settings', [
|
||||
'location' => $location,
|
||||
'branches' => $branches,
|
||||
'members' => PosMember::owned($owner)->with('location')->orderBy('created_at')->get(),
|
||||
'roles' => config('pos.roles', []),
|
||||
'hasMultiLocation' => $this->subscriptions->canUseMultiLocation($account),
|
||||
'hasTeamFeatures' => $this->subscriptions->canManageTeam($account),
|
||||
'canAddBranch' => $this->subscriptions->canAddLocation($account, $owner),
|
||||
'merchantImportEnabled' => (bool) config('pos.merchant_import_enabled', true),
|
||||
'tables' => $this->scopeToLocation($request, PosTable::owned($owner))
|
||||
->orderBy('area')->orderBy('position')->orderBy('label')->get(),
|
||||
|
||||
Reference in New Issue
Block a user