@extends('layouts.master') @section('title',__('Reports')) @section('breadcum') @endsection @section('maincontent')
@if (isset($all_reports) && count($all_reports->data) > 0)
{{ __('Stripe Report') }}
@php $sell = null; @endphp @foreach ($all_reports->data as $key => $report) @php \Stripe\Stripe::setApiKey(env('STRIPE_SECRET')); $customer_id = \Stripe\Customer::retrieve($report->customer); $user = Illuminate\Support\Facades\DB::table('users')->where('email', '=', $customer_id->email)->first(); $sell = $sell + (($report->plan->amount/100)); @endphp @endforeach
{{ __('#') }} {{__('Date')}} {{__('Subscribed Package')}} {{__('Paid Amount')}} {{__('Method')}} {{__('User')}}
{{$key+1}} {{date('d/m/Y',$report->items->data[0]->created)}} {{$report->items->data[0]->plan->id}} {{$report->plan->amount/100}} Stripe @if (isset($user)) {{$user->name ? $user->name : ''}} @else {{__('User Removed')}} @endif
{{__('Total Sells')}} {{isset($sell) ? $sell : ''}}
@endif @if (isset($paypal_subscriptions) && count($paypal_subscriptions) > 0)
{{ __('Paypal Report') }}
@foreach ($paypal_subscriptions as $key => $item) @php $sell = 0; $date = $item->created_at->toDateString(); $sell = $sell + $item->price; @endphp @endforeach
{{ __('#') }} {{__('Date')}} {{__('Subscribed Package')}} {{__('Paid Amount')}} {{__('Method')}} {{__('User')}}
{{$key+1}} {{$date}} {{$item->plan ? $item->plan->name : 'N/A'}} {{$item->price}} Paypal {{$item->user ? $item->user->name : 'N/A'}}
{{__('TotalSells')}} {{isset($sell) ? $sell : ''}}
@endif @endsection @section('script') @endsection