@extends('admin.layouts.app') @section('title', 'Custom send SMS page') @push('styles') @endpush @section('admin_content') @php use App\Models\SmsLog; $totalSms = config('sms.total_sms_limit'); // Get limit from config $totalSendSms = SmsLog::sum('total_message'); // Total sent SMS (all) $totalSentSms = SmsLog::where('delivery_report', 'success')->sum('total_message'); // Successfully sent SMS $remainingSms = max(0, $totalSms - $totalSentSms); // Ensure remaining SMS is never negative @endphp
- Total SMS: 2500 Total Send SMS: {{ $totalSendSms }} {{-- Remaining SMS: {{ $remainingSms }} --}}