@extends('admin.layouts.layout') @section('content')

All User & Orderdetails
@endsection @section('script') @php $admincount=\App\Models\User::where('user_type_id','1')->count(); $actorcount=\App\Models\User::where('user_type_id','2')->count(); $clientcount=\App\Models\User::where('user_type_id','3')->count(); $manufactorcount=\App\Models\User::where('user_type_id','4')->count(); $advertisercount=\App\Models\User::where('user_type_id','5')->count(); @endphp @php $ManufactorPaymentdetail = \App\Models\ManufactorPaymentdetails::selectRaw('YEAR(created_at) as year, MONTH(created_at) as month, SUM(total) as total') ->where('created_at', '>=', \Carbon\Carbon::now()->subMonths(12))->where('paymentstatus','1') ->groupBy('year', 'month') ->orderBy('year') ->orderBy('month') ->get(); $months = $ManufactorPaymentdetail->map(function ($record) { return \Carbon\Carbon::createFromDate($record->year, $record->month, 1)->format('M Y'); }); $totals = $ManufactorPaymentdetail->pluck('total'); @endphp @endsection