35 lines
993 B
PHP
35 lines
993 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Api;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\Advertisement;
|
|
use App\Models\Customer;
|
|
use App\Models\SpatialPlanning;
|
|
use Illuminate\Http\Request;
|
|
use App\Models\TourismBasedKBLI;
|
|
|
|
class LackOfPotentialController extends Controller
|
|
{
|
|
|
|
public function count_lack_of_potential(){
|
|
try{
|
|
$total_reklame = Advertisement::count();
|
|
$total_pdam = Customer::count();
|
|
$total_tata_ruang = SpatialPlanning::count();
|
|
$data_report_tourism = TourismBasedKBLI::all();
|
|
|
|
return response()->json([
|
|
'total_reklame' => $total_reklame,
|
|
'total_pdam' => $total_pdam,
|
|
'total_tata_ruang' => $total_tata_ruang,
|
|
'data_report' => $data_report_tourism,
|
|
], 200);
|
|
}catch(\Exception $e){
|
|
return response()->json([
|
|
'message' => 'Error: '.$e->getMessage()
|
|
], 500);
|
|
}
|
|
}
|
|
}
|