<?php
/** @var \App\Models\Client $client */
?>
@extends('layouts.app')

@section('content')
    <div class="container">
        <div class="row justify-content-center">
            <div class="col-6">
                <form action="{{ $client->id ? route('adm.client.update', [$client->id]) : route('adm.client.store') }}" method="post">
                    @csrf
                    @if($client->id)
                       @method('PUT')
                        <div class="row mb-3">
                            <div class="col">
                                <h1>編輯: {{ $client->name }} {{ $client->id }}</h1>
                            </div>
                        </div>
                    @endif
                    <x-success-alert></x-success-alert>
                    <x-validation-alert></x-validation-alert>
                    <x-model-form-control-group :model="$client" attr="name" label="名稱" :required="true"></x-model-form-control-group>
                    <button type="submit" class="btn btn-success">
                        @if($client->id)
                            Update
                        @else
                            Create
                        @endif
                    </button>
                </form>
            </div>
        </div>
    </div>
@endsection
