
<form action="{{route('services.sub_services.save_element')}}" method="post" >
    @csrf

    <input type="hidden" id="sub_services_id"  name="sub_services_id" value="{{$id_sub_services}}">
    <div class="row">
        <div class="col-5">
            <input type="text" id="title_en"  name="title_en"  placeholder="Element En">
           
        </div>
        <div class="col-5">
            
            <input type="text" id="title_ar"  name="title_ar" placeholder="Element Ar">
        </div>

        <div class="col-2">
            <button type="submit" class="btn btn-primary">Add</button>

        </div>

    </div>
   
    @if(@isset($sub_services_elements) && !@empty($sub_services_elements) && count($sub_services_elements) >0) 

        <div class="col-12 row" style="margin-top: 30px">
                <table class="table">
                    <thead>
                        <th>#</th>
                        <th>Title En</th>
                        <th>Title Ar</th>
                        <th>Action</th>
                    </thead>
                    <tbody>
                        @foreach( $sub_services_elements as $index=> $sub_services_element)
                
                        <tr>
                            <td>{{$index + 1}}</td>
                            <td>{{$sub_services_element->title_en}}</td>
                            <td>{{$sub_services_element->title_ar}}</td>
                            <td>                   
                                 <a href="{{ route('sub_services.element.delete', $sub_services_element->id) }}" class="btn btn-danger btn-sm" style="margin-bottom: 10px; ">delete</a>
                            </td>
                        </tr>
                        @endforeach
                    </tbody>
                </table>
                
            
        </div>

            
            
            
    @else
        <div class="col-12" style="margin-top: 30px">
            <div class="alert alert-primary" role="alert">
                No Elements
            </div>
        </div>
    @endif

   
   

</form>

  