diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 3e866efd..00000000 Binary files a/.DS_Store and /dev/null differ diff --git a/Modules/Platform/app/Http/Controllers/PlatformPriceController.php b/Modules/Platform/app/Http/Controllers/PlatformPriceController.php index aa6102c0..8c365551 100644 --- a/Modules/Platform/app/Http/Controllers/PlatformPriceController.php +++ b/Modules/Platform/app/Http/Controllers/PlatformPriceController.php @@ -11,6 +11,20 @@ use Modules\Platform\app\Models\PlatformPrice; class PlatformPriceController extends Controller { + + /** + * Display the customer-facing platform pricing cards. + */ + public function publicIndex(): View + { + return view('platform::prices.public', [ + 'prices' => PlatformPrice::query() + ->where('is_active', true) + ->ordered() + ->get(), + ]); + } + /** * Display platform prices in a card grid with administration actions. */ diff --git a/Modules/Platform/resources/views/prices/create.blade.php b/Modules/Platform/resources/views/prices/create.blade.php index e076c88d..e64dbfa2 100644 --- a/Modules/Platform/resources/views/prices/create.blade.php +++ b/Modules/Platform/resources/views/prices/create.blade.php @@ -1,15 +1,14 @@
-
-
-
-

Administration

-

Create price

-

Add a new platform pricing card with billing values, feature bullets and status controls.

-
- Back to prices -
-
+
+

+ Add a new platform pricing card with billing values, feature bullets and status controls. +

+ + + Back to prices + +
@@ -17,8 +16,12 @@ @include('platform::prices._form')
- Cancel - + + Cancel + +
diff --git a/Modules/Platform/resources/views/prices/edit.blade.php b/Modules/Platform/resources/views/prices/edit.blade.php index 1d74cd8a..99fa06bb 100644 --- a/Modules/Platform/resources/views/prices/edit.blade.php +++ b/Modules/Platform/resources/views/prices/edit.blade.php @@ -1,15 +1,14 @@
-
-
-
-

Administration

-

Edit {{ $price->name }}

-

Update the pricing card, feature list and visibility settings without changing the rest of the platform.

-
- Back to prices -
-
+
+

+ Update {{ $price->name }} pricing, feature list and visibility settings. +

+ + + Back to prices + +
@@ -18,8 +17,12 @@ @include('platform::prices._form')
- Cancel - + + Cancel + +
diff --git a/Modules/Platform/resources/views/prices/index.blade.php b/Modules/Platform/resources/views/prices/index.blade.php index dab1a4fc..7fef9cd2 100644 --- a/Modules/Platform/resources/views/prices/index.blade.php +++ b/Modules/Platform/resources/views/prices/index.blade.php @@ -1,18 +1,21 @@ - +
-
-
-
-

Platform

-

Pricing plans

-

Maintain customer-facing Basic, Advanced and Pro pricing from one administration page.

-
- +
+
+

+ Customer-facing plan cards managed from Platform. +

-
+ + +
@if (session('status'))
@@ -29,31 +32,49 @@ ? 'from-cyan-500 to-blue-600' : ($isBasic ? 'from-slate-700 to-slate-900' : 'from-indigo-600 to-violet-700'); @endphp +
@if ($price->is_featured) -
Featured
+
+ Featured +
@endif
-

{{ $price->badge_label ?: 'Plan' }}

+

+ {{ $price->badge_label ?: 'Plan' }} +

{{ $price->name }}

+
+

{{ $price->strapline }}

- {{ $price->formatAmount($price->monthly_amount) }} + + {{ $price->formatAmount($price->monthly_amount) }} + / month
-

Annual: {{ $price->formatAmount($price->annual_amount) }}

-

{{ $price->description }}

+ +

+ Annual: + + {{ $price->formatAmount($price->annual_amount) }} + +

+ +

+ {{ $price->description }} +

    @foreach ($price->featureRows() as $feature) @@ -68,12 +89,17 @@ {{ $price->is_active ? 'Active' : 'Hidden' }} +
    - Edit + + Edit +
    @csrf @method('DELETE') - +
diff --git a/Modules/Platform/resources/views/prices/public.blade.php b/Modules/Platform/resources/views/prices/public.blade.php new file mode 100644 index 00000000..03cada62 --- /dev/null +++ b/Modules/Platform/resources/views/prices/public.blade.php @@ -0,0 +1,85 @@ + +
+
+
+
+

Platform

+

Platform pricing

+

Choose the right WMS plan for warehouse visibility, operational control and enterprise-grade administration.

+
+ +
+
+

Plans

+

+ + {{ $prices->count() }} +

+
+
+

Billing

+

Monthly

+
+
+
+
+ +
+ @forelse ($prices as $price) + @php + $isBasic = $price->code === 'basic'; + $isAdvanced = $price->code === 'advanced'; + $headerClass = $isAdvanced + ? 'from-cyan-500 to-blue-600' + : ($isBasic ? 'from-slate-700 to-slate-950' : 'from-indigo-600 to-violet-700'); + @endphp + +
+ @if ($price->is_featured) +
{{ $price->badge_label ?: 'Popular' }}
+ @endif + +
+
+
+

{{ $price->badge_label ?: 'Plan' }}

+

{{ $price->name }}

+
+ + + +
+

{{ $price->strapline }}

+
+ +
+
+ {{ $price->formatAmount($price->monthly_amount) }} + / month +
+ + @if ($price->annual_amount) +

Annual: {{ $price->formatAmount($price->annual_amount) }}

+ @endif + +

{{ $price->description }}

+ +
    + @foreach ($price->featureRows() as $feature) +
  • + + {{ $feature }} +
  • + @endforeach +
+
+
+ @empty +
+

No active prices

+

Add active pricing records from Administration to populate this page.

+
+ @endforelse +
+
+
diff --git a/Modules/Platform/routes/web.php b/Modules/Platform/routes/web.php index a0d6a712..d272f04c 100644 --- a/Modules/Platform/routes/web.php +++ b/Modules/Platform/routes/web.php @@ -8,6 +8,14 @@ use Modules\Platform\app\Http\Controllers\PlatformDashboardController; use Modules\Platform\app\Http\Controllers\PlatformPriceController; use Modules\Platform\app\Http\Controllers\StripeWebhookController; + +Route::middleware(['auth', 'verified', 'tenant.assigned']) + ->prefix('platform') + ->name('platform.') + ->group(function (): void { + Route::get('/pricing', [PlatformPriceController::class, 'publicIndex'])->name('pricing.index'); + }); + Route::middleware(['auth', 'verified', 'tenant.assigned', 'platform.admin']) ->prefix('admin') ->name('platform.') diff --git a/Modules/Pricing/Http/Controllers/PricingController.php b/Modules/Pricing/Http/Controllers/PricingController.php index f21fa9fa..c340275c 100644 --- a/Modules/Pricing/Http/Controllers/PricingController.php +++ b/Modules/Pricing/Http/Controllers/PricingController.php @@ -3,77 +3,21 @@ namespace Modules\Pricing\Http\Controllers; use Illuminate\Contracts\Support\Renderable; -use Illuminate\Http\Request; use Illuminate\Routing\Controller; +use Modules\Platform\app\Models\PlatformPrice; class PricingController extends Controller { /** - * Display a listing of the resource. - * @return Renderable + * Display the platform pricing cards from the shared Platform price model. */ - public function index() + public function index(): Renderable { - return view('pricing::index'); - } - - /** - * Show the form for creating a new resource. - * @return Renderable - */ - public function create() - { - return view('pricing::create'); - } - - /** - * Store a newly created resource in storage. - * @param Request $request - * @return Renderable - */ - public function store(Request $request) - { - // - } - - /** - * Show the specified resource. - * @param int $id - * @return Renderable - */ - public function show($id) - { - return view('pricing::show'); - } - - /** - * Show the form for editing the specified resource. - * @param int $id - * @return Renderable - */ - public function edit($id) - { - return view('pricing::edit'); - } - - /** - * Update the specified resource in storage. - * @param Request $request - * @param int $id - * @return Renderable - */ - public function update(Request $request, $id) - { - // - } - - /** - * Remove the specified resource from storage. - * @param int $id - * @return Renderable - */ - public function destroy($id) - { - // + return view('platform::prices.public', [ + 'prices' => PlatformPrice::query() + ->where('is_active', true) + ->ordered() + ->get(), + ]); } } diff --git a/Modules/Pricing/Routes/web.php b/Modules/Pricing/Routes/web.php index 2dcb7c83..9262e693 100644 --- a/Modules/Pricing/Routes/web.php +++ b/Modules/Pricing/Routes/web.php @@ -1,16 +1,11 @@ group(function() { - Route::get('/', 'PricingController@index'); -}); +Route::middleware(['auth', 'verified', 'tenant.assigned']) + ->prefix('pricing') + ->name('pricing.') + ->group(function (): void { + Route::get('/', [PricingController::class, 'index'])->name('index'); + }); diff --git a/resources/views/layouts/app/sidebar.blade.php b/resources/views/layouts/app/sidebar.blade.php index e437ed9e..f6d35a4e 100644 --- a/resources/views/layouts/app/sidebar.blade.php +++ b/resources/views/layouts/app/sidebar.blade.php @@ -232,6 +232,9 @@ $pageTitle = $title ?? __('Warehouse Management System'); $pageDescription = match (true) { request()->routeIs('platform.dashboard') => __('Manage tenant companies, licences, payments, warehouses and internal API operations from one resilient control plane.'), + request()->routeIs('platform.prices.index') => __('Choose, publish and maintain Basic, Advanced and Pro WMS pricing from one controlled platform screen.'), + request()->routeIs('platform.prices.create') => __('Create a professional customer-facing pricing card with billing values, features and visibility controls.'), + request()->routeIs('platform.prices.edit') => __('Update pricing, plan features and card visibility while preserving the live platform layout.'), request()->routeIs('platform.companies.*') => __('Manage tenant companies, ownership, users and the warehouse records attached to each organisation.'), request()->routeIs('platform.licenses.*') => __('Review licence allocation, account status and platform access across MPBA tenants.'), request()->routeIs('platform.payments.*') => __('Track payment activity, paid totals and tenant billing status from one administration screen.'), @@ -240,6 +243,17 @@ request()->routeIs('analytics.*') => __('Review operational insight, warehouse trends and management reporting.'), default => __('Manage tenant companies, licences, payments, warehouses and internal API operations from one resilient control plane.'), }; + + $pageStats = match (true) { + request()->routeIs('platform.prices.*') => [ + ['label' => __('Plans'), 'value' => '3', 'icon' => 'fa-layer-group'], + ['label' => __('Billing'), 'value' => __('Monthly'), 'icon' => null], + ], + default => [ + ['label' => __('System status'), 'value' => __('OK'), 'icon' => 'fa-heart-pulse'], + ['label' => __('Paid £'), 'value' => '0.00', 'icon' => null], + ], + }; @endphp
@@ -255,15 +269,17 @@ -
- {{ __('System status') }} - {{ __('OK') }} -
- -
- {{ __('Paid £') }} - 0.00 -
+ @foreach ($pageStats as $stat) +
+ {{ $stat['label'] }} + + @if (! empty($stat['icon'])) + + @endif + {{ $stat['value'] }} + +
+ @endforeach
diff --git a/storage/framework/views/359ae57a7ef889ada0c6818b0f826987.php b/storage/framework/views/359ae57a7ef889ada0c6818b0f826987.php new file mode 100755 index 00000000..29a7fd95 --- /dev/null +++ b/storage/framework/views/359ae57a7ef889ada0c6818b0f826987.php @@ -0,0 +1,107 @@ + + + 'f4ac99e09542ff494432bc959d4fee61::app','data' => ['title' => __('Pricing')]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?> +withName('layouts::app'); ?> +shouldRender()): ?> +startComponent($component->resolveView(), $component->data()); ?> + +except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?> + +withAttributes(['title' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(__('Pricing'))]); ?> + + +
+
+
+
+

Platform

+

Platform pricing

+

Choose the right WMS plan for warehouse visibility, operational control and enterprise-grade administration.

+
+ +
+
+

Plans

+

+ + count()); ?> + +

+
+
+

Billing

+

Monthly

+
+
+
+
+ +
+ addLoop($__currentLoopData); foreach($__currentLoopData as $price): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?> + code === 'basic'; + $isAdvanced = $price->code === 'advanced'; + $headerClass = $isAdvanced + ? 'from-cyan-500 to-blue-600' + : ($isBasic ? 'from-slate-700 to-slate-950' : 'from-indigo-600 to-violet-700'); + ?> + +
+ is_featured): ?> +
badge_label ?: 'Popular'); ?>
+ + +
+
+
+

badge_label ?: 'Plan'); ?>

+

name); ?>

+
+ + + +
+

strapline); ?>

+
+ +
+
+ formatAmount($price->monthly_amount)); ?> + / month +
+ + annual_amount): ?> +

Annual: formatAmount($price->annual_amount)); ?>

+ + +

description); ?>

+ +
    + featureRows(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $feature): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> +
  • + + +
  • + popLoop(); $loop = $__env->getLastLoop(); ?> +
+
+
+ popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?> +
+

No active prices

+

Add active pricing records from Administration to populate this page.

+
+ +
+
+ renderComponent(); ?> + + + + + + + + + + \ No newline at end of file diff --git a/storage/framework/views/3d7c4a50df1d313410bd5444267891cf.php b/storage/framework/views/3d7c4a50df1d313410bd5444267891cf.php index 5c8a7bf0..774f1b98 100755 --- a/storage/framework/views/3d7c4a50df1d313410bd5444267891cf.php +++ b/storage/framework/views/3d7c4a50df1d313410bd5444267891cf.php @@ -16,228 +16,228 @@ - - make('partials.head', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?> - + + make('partials.head', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?> + - -
-
+ +
+
- -
-
- - -
-
-
- -forceAssetInjection(); ?>
- + forceAssetInjection(); ?>
+