Add freemium plans, wallet-billed host notifications, and Pro upgrades.
Deploy Ladill Frontdesk / deploy (push) Successful in 44s
Deploy Ladill Frontdesk / deploy (push) Successful in 44s
Host alerts use email/phone on the host record without requiring a Ladill account link; SMS and over-quota emails debit the org wallet at platform rates. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6,6 +6,9 @@ use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Frontdesk\Concerns\ScopesToAccount;
|
||||
use App\Models\Branch;
|
||||
use App\Services\Frontdesk\FrontdeskPermissions;
|
||||
use App\Services\Frontdesk\NotificationPricingService;
|
||||
use App\Services\Frontdesk\NotificationUsageService;
|
||||
use App\Services\Frontdesk\PlanService;
|
||||
use App\Support\OrganizationBranding;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -15,7 +18,7 @@ class SettingsController extends Controller
|
||||
{
|
||||
use ScopesToAccount;
|
||||
|
||||
public function edit(Request $request): View
|
||||
public function edit(Request $request, PlanService $plans, NotificationUsageService $usage, NotificationPricingService $pricing): View
|
||||
{
|
||||
$this->authorizeAbility($request, 'settings.view');
|
||||
$organization = $this->organization($request);
|
||||
@@ -25,6 +28,10 @@ class SettingsController extends Controller
|
||||
->where('organization_id', $organization->id)
|
||||
->count();
|
||||
|
||||
$monthlyUsage = $usage->forOrganization($organization);
|
||||
$plan = $plans->plan($organization);
|
||||
$freeEmailAllowance = $plans->freeEmailsPerMonth($organization);
|
||||
|
||||
return view('frontdesk.settings.edit', [
|
||||
'organization' => $organization,
|
||||
'canManage' => $canManage,
|
||||
@@ -33,6 +40,15 @@ class SettingsController extends Controller
|
||||
'deviceTypes' => config('frontdesk.device_types'),
|
||||
'notificationChannels' => config('frontdesk.notification_channels'),
|
||||
'notificationEvents' => config('frontdesk.notification_events'),
|
||||
'plan' => $plan,
|
||||
'isPro' => $plans->isPro($organization),
|
||||
'proPriceMinor' => $plans->proPriceMinor(),
|
||||
'monthlyUsage' => $monthlyUsage,
|
||||
'freeEmailAllowance' => $freeEmailAllowance,
|
||||
'emailCostFormatted' => $pricing->formatMinor($pricing->emailCostMinor()),
|
||||
'smsCostFormatted' => $pricing->formatMinor(
|
||||
$pricing->smsCostMinor('Sample SMS message for pricing display.'),
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user