<!DOCTYPE html>
<html>
<head>
    <title>Laravel Cache Commands</title>
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <style>
        body {
            font-family: Arial, sans-serif;
            background: #f5f7fb;
            padding: 40px;
        }

        .box {
            max-width: 650px;
            margin: auto;
            background: #ffffff;
            padding: 30px;
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.08);
        }

        h2 {
            margin-top: 0;
            color: #222;
        }

        p {
            color: #666;
        }

        .alert {
            padding: 12px 15px;
            border-radius: 7px;
            margin-bottom: 18px;
        }

        .success {
            background: #e7f8ec;
            color: #137333;
            border: 1px solid #b7e4c7;
        }

        .error {
            background: #fdeaea;
            color: #b42318;
            border: 1px solid #f5c2c0;
        }

        .grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 14px;
            margin-top: 25px;
        }

        form {
            margin: 0;
        }

        button {
            width: 100%;
            border: none;
            padding: 14px 16px;
            border-radius: 8px;
            color: #ffffff;
            font-weight: 600;
            cursor: pointer;
            font-size: 15px;
        }

        .blue {
            background: #2563eb;
        }

        .green {
            background: #16a34a;
        }

        .purple {
            background: #7c3aed;
        }

        .red {
            background: #dc2626;
        }

        .full {
            grid-column: span 2;
        }

        .note {
            margin-top: 25px;
            background: #fff7ed;
            color: #9a3412;
            padding: 14px;
            border-radius: 8px;
            border: 1px solid #fed7aa;
            font-size: 14px;
        }
    </style>
</head>

<body>

<div class="box">
    <h2>Laravel Cache Commands</h2>

    <p>
        Click the buttons below to run Laravel cache and config commands.
    </p>

    @if(session('success'))
        <div class="alert success">
            {{ session('success') }}
        </div>
    @endif

    @if(session('error'))
        <div class="alert error">
            {{ session('error') }}
        </div>
    @endif

    <div class="grid">

        <form method="POST" action="{{ route('artisan.commands.run') }}">
            @csrf
            <input type="hidden" name="command" value="config:clear">
            <button type="submit" class="blue">
                config:clear
            </button>
        </form>

        <form method="POST" action="{{ route('artisan.commands.run') }}">
            @csrf
            <input type="hidden" name="command" value="cache:clear">
            <button type="submit" class="green">
                cache:clear
            </button>
        </form>

        <form method="POST" action="{{ route('artisan.commands.run') }}">
            @csrf
            <input type="hidden" name="command" value="config:cache">
            <button type="submit" class="purple">
                config:cache
            </button>
        </form>

        <form method="POST" action="{{ route('artisan.commands.run') }}" class="full">
            @csrf
            <input type="hidden" name="command" value="clear-all">
            <button type="submit" class="red">
                Run All Commands
            </button>
        </form>

    </div>

    <div class="note">
        Important: Live website par is page ko public na rakhein. Better hai is route par auth middleware zaroor lagayen.
    </div>
</div>

</body>
</html>