@extends('admin.layouts.app')

@section('content')
<div class="container-fluid">
    <h2>{{ $subject }}</h2>
    <hr/>
    <p>
      <h5>Available Drivers</h5>
      {{ $drivers }}
    </p>
    <br/>
    <h5>Databases</h5>
    @foreach($database['connections'] as $driver => $config)
    <br/>
    <p><strong>{{ $driver }}</strong></p>
    <table class="table table-bordered">
        <thead>
          <tr>
            <th scope="col">Driver</th>
            <th scope="col">Host</th>
            <th scope="col">Port</th>
            <th scope="col">Database</th>
            <th scope="col">Username</th>
            <th scope="col">Password</th>
            <th scope="col">Charset</th>
            <th scope="col">Prefix</th>
          </tr>
        </thead>
        <tbody>
            <tr>
                <td scope="row">{{ $loop->index }}</td>
                <td scope="row">{{ $config['host'] ?? '-' }}</td>
                <td scope="row">{{ $config['port'] ?? '-' }}</td>
                <td scope="row">{{ $config['database'] ?? '-' }}</td>
                <td scope="row">{{ $config['username'] ?? '-' }}</td>
                <td scope="row">{{ $config['password'] ?? '-' }}</td>
                <td scope="row">{{ $config['charset'] ?? '-' }}</td>
                <td scope="row">{{ $config['prefix'] ?? '-' }}</td>
            </tr>
        </tbody>
    </table>
    @endforeach
    <br/>
    <h5>Redis</h5>
    <br/>
    <p><strong>default</strong></p>
    <table class="table table-bordered">
        <thead>
          <tr>
            <th scope="col">URL</th>
            <th scope="col">Host</th>
            <th scope="col">Port</th>
            <th scope="col">Database</th>
            <th scope="col">Password</th>
          </tr>
        </thead>
        <tbody>
            <tr>
                <td scope="row">{{ $database['redis']['default']['url'] ?? '-' }}</td>
                <td scope="row">{{ $database['redis']['default']['host'] ?? '-' }}</td>
                <td scope="row">{{ $database['redis']['default']['port'] ?? '-' }}</td>
                <td scope="row">{{ $database['redis']['default']['database'] ?? '-' }}</td>
                <td scope="row">{{ $database['redis']['default']['password'] ?? '-' }}</td>
            </tr>
        </tbody>
    </table>
    <br/>
    <p><strong>cache</strong></p>
    <table class="table table-bordered">
        <thead>
          <tr>
            <th scope="col">URL</th>
            <th scope="col">Host</th>
            <th scope="col">Port</th>
            <th scope="col">Database</th>
            <th scope="col">Password</th>
          </tr>
        </thead>
        <tbody>
            <tr>
                <td scope="row">{{ $database['redis']['cache']['url'] ?? '-' }}</td>
                <td scope="row">{{ $database['redis']['cache']['host'] ?? '-' }}</td>
                <td scope="row">{{ $database['redis']['cache']['port'] ?? '-' }}</td>
                <td scope="row">{{ $database['redis']['cache']['database'] ?? '-' }}</td>
                <td scope="row">{{ $database['redis']['cache']['password'] ?? '-' }}</td>
            </tr>
        </tbody>
    </table>
</div>
@endsection
