@extends('layouts.installer')

@section('content')
    <div class="container">
        <div class="row justify-content-center align-content-center" style="height: 100vh;">
            <div class="col-md-6">
                <div class="card">
                    <div class="card-header" style="background: #d9dce2;">
                        <h1 class="h5 text-center m-0 card-title">Server Requirements</h1>
                    </div>
                    <div class="card-body px-md-5 text-center">
                        <ul class="list-group mb-5 pb-3">
                            <li class="list-group-item d-flex justify-content-between align-items-center" style="background: #eef0f4;">
                                <span class="font-weight-bold">PHP (version {{ $php['minimum'] }} required)</span>
                                <div class="text-{{ $php['supported'] ? 'success' : 'danger'}}">
                                    <span class="font-weight-bold">{{ $php['current'] }}</span>
                                    <i class="fas fa-{{ $php['supported'] ? 'check-circle text-success' : 'times-circle text-danger' }}"></i>
                                </div>
                            </li>
                            @foreach ($requirements['requirements']['php'] as $extention => $enabled)
                                <li class="list-group-item d-flex justify-content-between align-items-center">
                                    {{ ucwords($extention) }}
                                    <i class="fas fa-{{ $enabled ? 'check-circle text-success' : 'exclamation-circle text-danger' }}" aria-hidden="true"></i>
                                </li>
                            @endforeach
                        </ul>

                        @if ( ! isset($requirements['errors']) && $php['supported'] )
                            <a href="{{ route('install.environment') }}" class="btn btn-info">Configure <i class="ml-2 fas fa-chevron-right"></i></a>
                        @endif

                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
