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:
@@ -12,7 +12,6 @@ use App\Services\Pos\SubscriptionService;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class MemberController extends Controller
|
||||
{
|
||||
@@ -20,20 +19,13 @@ class MemberController extends Controller
|
||||
|
||||
public function __construct(private SubscriptionService $subscriptions) {}
|
||||
|
||||
public function index(Request $request): View|RedirectResponse
|
||||
public function index(Request $request): RedirectResponse
|
||||
{
|
||||
if ($redirect = $this->guardManage($request)) {
|
||||
return $redirect;
|
||||
}
|
||||
|
||||
$owner = $this->ownerRef($request);
|
||||
$members = PosMember::owned($owner)->with('location')->orderBy('created_at')->get();
|
||||
|
||||
return view('pos.team.index', [
|
||||
'members' => $members,
|
||||
'roles' => config('pos.roles', []),
|
||||
'branches' => PosLocation::owned($owner)->orderBy('name')->get(),
|
||||
]);
|
||||
return redirect()->route('pos.settings')->withFragment('team');
|
||||
}
|
||||
|
||||
public function store(Request $request, IdentityTeamClient $identity): RedirectResponse
|
||||
@@ -89,7 +81,7 @@ class MemberController extends Controller
|
||||
],
|
||||
);
|
||||
|
||||
return back()->with('success', 'Invitation sent to '.$email.'.');
|
||||
return back()->withFragment('team')->with('success', 'Invitation sent to '.$email.'.');
|
||||
}
|
||||
|
||||
public function destroy(Request $request, PosMember $member): RedirectResponse
|
||||
@@ -107,7 +99,7 @@ class MemberController extends Controller
|
||||
|
||||
$member->delete();
|
||||
|
||||
return back()->with('success', 'Team member removed.');
|
||||
return back()->withFragment('team')->with('success', 'Team member removed.');
|
||||
}
|
||||
|
||||
private function guardManage(Request $request): ?RedirectResponse
|
||||
|
||||
Reference in New Issue
Block a user