@extends('layouts.admin') @section('title', 'Membership Plans') @section('page_title', 'Membership Plans') @section('content') {{-- HEADER CARD WITH ADD BUTTON --}}
Membership Plans
{{-- ONLY SHOW IF LESS THAN 2 PLANS --}} @if($plans->count() < 2) @else Both plans created @endif
{{-- PLAN CARDS --}}
@forelse($plans as $plan)
{{-- HEADER --}}
{{-- ICON --}}
{{ $plan->type == 'LIFE' ? '♾️' : 'πŸ“…' }}
{{ $plan->name }}
{{ $plan->type }}
{{-- STATUS BADGE --}} {{ $plan->is_active ? 'Active' : 'Inactive' }}
{{-- AMOUNT --}}
β‚Ή{{ number_format($plan->amount, 0) }}
@if($plan->duration_months == 0) One time payment Β· Never expires @else Per year Β· {{ $plan->duration_months }} months duration @endif
{{-- DESCRIPTION --}} @if($plan->description)
{{ $plan->description }}
@endif {{-- FEATURES --}}
@if($plan->type == 'LIFE') @foreach(['Lifetime membership', 'Never expires', 'Priority event access', 'News & announcements'] as $feature)
βœ“ {{ $feature }}
@endforeach @else @foreach(['Full membership access', 'Event registration', 'News & announcements', 'Renewal required yearly'] as $feature)
βœ“ {{ $feature }}
@endforeach @endif
{{-- ACTIONS --}}
{{-- EDIT --}} {{-- TOGGLE STATUS --}}
@csrf
{{-- DELETE --}}
@csrf @method('DELETE')
@empty {{-- NO PLANS YET --}}
πŸ“‹
No plans created yet
Create LIFE and ANNUAL membership plans
@endforelse {{-- ADD NEW PLAN CARD --}} @if($plans->count() < 2)
βž•
Create New Plan
@if($plans->count() == 0) Add LIFE or ANNUAL plan @elseif($plans->first()->type == 'LIFE') Add ANNUAL plan @else Add LIFE plan @endif
@endif
{{-- PLAN SUMMARY TABLE --}} @if($plans->count() > 0)
Plans Summary
@foreach($plans as $plan) @endforeach
# Plan Name Type Amount Duration Status Created Actions
{{ $loop->iteration }} {{ $plan->name }} {{ $plan->type }} β‚Ή{{ number_format($plan->amount, 0) }} {{ $plan->duration_months == 0 ? 'Lifetime' : $plan->duration_months . ' months' }} {{ $plan->is_active ? 'Active' : 'Inactive' }} {{ $plan->created_at->format('d M Y') }}
@csrf
@csrf @method('DELETE')
@endif {{-- ══ ADD PLAN MODAL ══ --}}
Create Membership Plan
@csrf
{{-- ══ EDIT PLAN MODAL ══ --}}
Edit Plan
@csrf
@endsection @section('scripts') @endsection