Files
click-erp/app/Http/Controllers/DashboardController.php
2023-07-27 01:33:36 +00:00

45 lines
1.2 KiB
PHP
Executable File

<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models;
use Session;
class DashboardController extends Controller
{
public function index(){
$total_clients = Models\Client::count();
$ussd_clients = Models\Client::where('services', 'LIKE', '%ussd%')->orwhere('services', 'LIKE', '%A2P%')->count();
$sms_clients = Models\Client::where('services', 'LIKE', '%sms%')->count();
$voice_clients = Models\Client::where('services', 'LIKE', '%ivr%')->count();
$data = [
'page_title' => 'Dashboard',
'sms' => $sms_clients,
'ussd' => $ussd_clients,
'voice' => $voice_clients,
'total' => $total_clients
];
// dd($data);
return view('dashboard.index_two', $data);
}
public function getEvents(){
$event_arr = [
[
"title" => 'Airtel MW Top Up',
"start" => date("Y, m, d")
],
[
"title" => 'Airtel MW Top Down',
"start" => date("Y, m, d")
],
];
return response()->json($event_arr);
}
}