Move Branches and Team into Settings as Pro features.
Deploy Ladill Frontdesk / deploy (push) Successful in 48s

Gate multi-branch and team management behind paid plans, nest their
routes under Settings, and remove them from the sidebar Administration
section.
This commit is contained in:
isaacclad
2026-07-16 08:13:42 +00:00
parent 59433f2b7b
commit 5526a10342
19 changed files with 377 additions and 50 deletions
@@ -3,6 +3,7 @@
namespace App\Http\Controllers\Frontdesk;
use App\Http\Controllers\Controller;
use App\Http\Controllers\Frontdesk\Concerns\RequiresPlanFeature;
use App\Http\Controllers\Frontdesk\Concerns\ScopesToAccount;
use App\Models\Building;
use App\Models\ReceptionDesk;
@@ -12,13 +13,27 @@ use Illuminate\View\View;
class ReceptionDeskController extends Controller
{
use RequiresPlanFeature;
use ScopesToAccount;
private const FEATURE = 'branches';
private const UPGRADE_MESSAGE = 'Multi-branch management requires Frontdesk Pro.';
public function index(Request $request, Building $building): View
{
$this->authorizeAbility($request, 'admin.desks.view');
$this->authorizeOwner($request, $building);
if ($upgrade = $this->proFeatureUpgradeView(
$request,
self::FEATURE,
'Branches',
'Manage reception desks with Frontdesk Pro.',
)) {
return $upgrade;
}
$desks = $building->receptionDesks()->orderBy('name')->get();
return view('frontdesk.admin.desks.index', compact('building', 'desks'));
@@ -29,6 +44,10 @@ class ReceptionDeskController extends Controller
$this->authorizeAbility($request, 'admin.branches.manage');
$this->authorizeOwner($request, $building);
if ($deny = $this->denyWithoutFeature($request, self::FEATURE, self::UPGRADE_MESSAGE)) {
return $deny;
}
$validated = $request->validate([
'name' => ['required', 'string', 'max:255'],
'location' => ['nullable', 'string', 'max:255'],
@@ -50,6 +69,10 @@ class ReceptionDeskController extends Controller
$this->authorizeOwner($request, $desk);
abort_unless($desk->building_id === $building->id, 404);
if ($deny = $this->denyWithoutFeature($request, self::FEATURE, self::UPGRADE_MESSAGE)) {
return $deny;
}
$desk->delete();
return back()->with('success', 'Reception desk removed.');