@extends('layouts.demo10.base') @section('styles') @endsection @section('content') @php $packageModel = $package ?? null; $isEdit = ! blank($packageModel); $selectedModuleIds = old('modules'); $oldOrDefault = static function (string $key, $default) { $value = old($key); return blank($value) ? $default : $value; }; if (! is_array($selectedModuleIds) || empty($selectedModuleIds)) { $selectedModuleIds = $isEdit ? $packageModel->modules->pluck('id')->map(fn ($id) => (string) $id)->all() : []; } $packageNameValue = $oldOrDefault('name', $packageModel->name ?? ''); $packageTagValue = $oldOrDefault('tag', data_get($packageModel?->meta, 'tag', '')); $packageDescriptionValue = $oldOrDefault('description', $packageModel->description ?? ''); $monthlyPriceValue = $oldOrDefault('monthly_price', $isEdit ? number_format((float) ($packageModel->monthly_price ?? $packageModel->price), 0, '.', '') : ''); $yearlyPriceValue = $oldOrDefault('yearly_price', $isEdit ? number_format((float) ($packageModel->yearly_price ?? ((float) ($packageModel->monthly_price ?? $packageModel->price) * 12)), 0, '.', '') : ''); $yearlyDiscountValue = $oldOrDefault('yearly_discount', $isEdit ? (string) ($packageModel->yearly_discount ?? 0) : ''); $monthlyEnabledValue = filled(old('monthly_enabled')) ? true : ($isEdit ? (($packageModel->billing_cycle ?? 'monthly') === 'monthly') : true); $yearlyEnabledValue = filled(old('yearly_enabled')) ? true : ($isEdit ? (($packageModel->billing_cycle ?? 'monthly') === 'yearly') : false); $trialEnabledValue = filled(old('trial_enabled')) ? old('trial_enabled') : ($packageModel->trial_enabled ?? false); $initialIconUrl = $isEdit && ! blank($packageModel->icon_path) ? asset('storage/' . ltrim($packageModel->icon_path, '/')) : ''; $initialIconLabel = $isEdit && ! blank($packageModel->icon_path) ? basename($packageModel->icon_path) : ''; @endphp
@csrf @if($isEdit) @method('PUT') @endif

{{ $isEdit ? 'Edit Package' : 'Create Packages' }}

Home / Packages / {{ $isEdit ? 'Edit' : 'Create' }}
{{-- --}}
-> ->

Basic Info

Start with the package identity and headline copy.
Upload Icon or use Emoji
SVG, PNG, JPG or GIF (max. 800x400px)

Pricing

Define the billing cycle and price points for this package.
Monthly Billing
Standard billing cycle applied every 30 days.
$ / month
Yearly Billing
Offer a discount for annual commitment.
$ / year
% discount
Effective monthly price: $79.16
Customers save around 20% with yearly billing.

Modules & Features

Choose which modules from your system will be included in this package.
@forelse ($modules ?? [] as $module) @php $moduleId = (string) $module->id; $moduleName = (string) $module->name; $moduleIconSvg = filled($module->icon_svg ?? null) ? $module->icon_svg : null; $moduleInitial = mb_strtoupper(mb_substr($moduleName, 0, 1)); @endphp @empty
No modules found in the database.
@endforelse
{{--
Additional Features
+ Add Feature
--}} {{--
  • Up to 10 team members
  • Unlimited projects
  • Advanced analytics dashboard
--}}
@endsection @section('scripts') @vite('resources/js/pages/packages.js') @endsection