 @extends('admin.layouts.main-layout')
 @section('content')
   <div class="container">
        <div class="justify-content-center">
            <div class="">
                <div class="card">
                    <div class="card-header">Update Game</div>
                    <div class="card-body">
                        @if ($errors->any())
                            <div class="alert alert-danger">
                                <ul>
                                    @foreach ($errors->all() as $error)
                                        <li>{{ $error }}</li>
                                    @endforeach
                                </ul>
                            </div>
                        @endif
                         <form role="form" method="post" onsubmit="return validateForm('addsstatus')" class="addsstatus" action="{{url('admin/games/'.$detail->id)}}" autocomplete="off" enctype="multipart/form-data">
                             @csrf
                             {{ method_field('PATCH') }}
                       

                            <div class="form-group">
                                <label for="title">Select Group <span class="require label-mandatory">*</span></label>
                                <select  class="form-control select2 input-mandatory" name="game_group_id">
                                <option>
                                    Select Group
                                </option>

                                @if(!empty($gameGroup))

                                @foreach($gameGroup as $group)
                                <option value="{{$group->id}}" {{$detail->id == $group->id ? 'Selected' : ''}}>
                                    {{$group->name}}
                                </option>
                                @endforeach
                                @endif
                                
                            </select>
                            </div>
                            <div class="form-group">
                                <label for="title">Name <span class="require label-mandatory">*</span></label>
                                <input type="text" class="form-control input-mandatory"
                                       name="name" id="name"  placeholder="" value="{{$detail->name}}">
                            </div>
                          
                            <br>
                            <div class="form-group">

                                <button type="submit"  class="btn btn-primary" >Submit</button>
                            </div>

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