app/Http/Controllers/HostingController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index()
    {
        $ch = curl_init();
        $data = array("key" => "hallobro", "action" => 'list');
        $url = 'https://ta.poliwangi.ac.id:2304/v1/account';
        $headers = array();
        $headers[] = 'Content-Type: application/x-www-form-urlencoded';
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        $response = curl_exec($ch);
        $result = json_decode($response, true);
        curl_close($ch);
        $pendaftar = Pendaftaran::select('id')->count();
        return view('hosting.index', compact('result'), compact('pendaftar'));
    }
public function index ( ) { $ ch = curl_init ( ) ; $ data = array ( " key " => " hallobro " , " action " => 'list' ) ; $ url = 'https://ta.poliwangi.ac.id:2304/v1/account' ; $ headers = array ( ) ; $ headers [ ] = 'Content-Type: application/x-www-form-urlencoded' ; curl_setopt ( $ ch , CURLOPT_HTTPHEADER , $ headers ) ; curl_setopt ( $ ch , CURLOPT_URL , $ url ) ; curl_setopt ( $ ch , CURLOPT_RETURNTRANSFER , 1 ) ; curl_setopt ( $ ch , CURLOPT_POST , 1 ) ; curl_setopt ( $ ch , CURLOPT_POSTFIELDS , http_build_query ( $ data ) ) ; curl_setopt ( $ ch , CURLOPT_SSL_VERIFYHOST , FALSE ) ; curl_setopt ( $ ch , CURLOPT_SSL_VERIFYPEER , FALSE ) ; $ response = curl_exec ( $ ch ) ; $ result = json_decode ( $ response , true ) ; curl_close ( $ ch ) ; $ pendaftar = Pendaftaran :: select ( 'id' ) -> count ( ) ; return view ( 'hosting.index' , compact ( 'result' ) , compact ( 'pendaftar' ) ) ; }
Display a listing of the resource.
Display a listing of the resource .
// Ambil data API dari CWP // Ambil total pendaftar