Ejemplo n.º 1
0
 /**
  * Resolve WHOIS data for domain.
  *
  * @param Request $request
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  * @throws \Exception
  */
 public function index(Request $request)
 {
     $domain = $request->input('domain');
     $isAvailable = false;
     $response = '';
     if ($domain) {
         $whoisServersJson = base_path('vendor/helgesverre/domain-availability/src/data/servers.json');
         $whoisClient = new SimpleWhoisClient();
         $dataLoader = new JsonLoader($whoisServersJson);
         $service = new DomainAvailability($whoisClient, $dataLoader);
         $isAvailable = $service->isAvailable($domain);
         $response = $whoisClient->getResponse();
     }
     return view('whois.form', compact('domain', 'isAvailable', 'response'));
 }
Ejemplo n.º 2
0
            </td>
        </tr>
        <tr>
            <td>WHOIS Server</td>
            <td><?php 
echo $whoisClient->getServer();
?>
</td>
        </tr>
        <tr>
            <td>Server Port</td>
            <td><?php 
echo $whoisClient->getPort();
?>
</td>
        </tr>
        <tr>
            <td colspan="2">
                <pre><?php 
echo $whoisClient->getResponse();
?>
</pre>
            </td>
        </tr>
    </table>

</div>
</body>
</html>