@extends('layouts.admin') @section('title', $moduleTitle ?? 'Plans') @push('styles') @endpush @section('content') @if(session('success'))
{{ session('success') }}
@endif
@forelse(($plans ?? []) as $plan) @php $features = is_array($plan->features) ? $plan->features : (is_string($plan->features) && $plan->features !== '' ? (json_decode($plan->features, true) ?: []) : []); $limits = is_array($plan->limits) ? $plan->limits : (is_string($plan->limits) && $plan->limits !== '' ? (json_decode($plan->limits, true) ?: []) : []); @endphp @empty @endforelse
Name Monthly Price Yearly Price Features Limits Status Actions
{{ $plan->name }}
@if($plan->description)
{{ Str::limit($plan->description, 60) }}
@endif
@if(($plan->price_monthly ?? 0) > 0) ₦{{ number_format($plan->price_monthly, 2) }} @else Free @endif @if(($plan->price_yearly ?? 0) > 0) ₦{{ number_format($plan->price_yearly, 2) }} @else Free @endif {{ count($features) }} features @if(!empty($limits))
@foreach($limits as $limitKey => $limitVal) {{ str_replace('_', ' ', str_replace('max_', '', $limitKey)) }}: {{ $limitVal == -1 ? '∞' : $limitVal }} @endforeach
@else No limits @endif
{{ $plan->is_active ? 'Active' : 'Inactive' }}
@csrf @method('PATCH')
No {{ $module }} plans created yet.
@endsection