@extends('Admin.master_page')
@section('small_title')
Category
@endsection
@section('content')



                <div class="page-content">
                    <div class="container-fluid">

                        <!-- start page title -->
                        <div class="row">
                            <div class="col-12">
                                <div class="page-title-box d-sm-flex align-items-center justify-content-between">
                                    <h4 class="mb-sm-0 font-size-18"> Category </h4>

                                    <div class="page-title-right">
                                        <ol class="breadcrumb m-0">
                                            <li class="breadcrumb-item"><a href="{{route('dashboard.index')}}">Dashboard</a></li>
                                            <li class="breadcrumb-item active">Category </li>
                                        </ol>
                                    </div>

                                </div>
                            </div>
                            @if(Session::has('message'))
                            <div class="alert alert-info">{{ Session::get('message') }}</div>

                            @endif

                        </div>
                        <!-- end page title -->


                        <div class="row">
                            <div class="col-12">
                                <div class="card">
                                    <div class="card-header">
                                        <a type="button" href="{{route('news.create')}}" class="btn btn-primary ">
                                            Add
                                        </a>
                                    </div>
                                    <div class="card-body">
                                        <div class="table-rep-plugin">
                                            <div class="table-responsive mb-0" data-pattern="priority-columns">

                                                <div class="table-responsive">

                                                    <table class="table table-striped">
                                                    <tr>
                                                        <th>Title (English) </th>
                                                        {{-- <th>Image</th>
                                                        <th>Description (English)</th>
                                                        <th>{{__("lable.date")}}</th>
 --}}
                                                        <th width="20">Action</th>

                                                    </tr>

                                                    @foreach($WhatWes as $whatwe)

                                                    <tr>
                                                        <td>
                                                            <p>{{ $whatwe->title }}</p>


                                                        </td>
                                                        {{-- <td>
                                                            <img src="{{render_image_path($whatwe->image)}}" width="150" height="100" title="{{ $whatwe->title}} image">
                                                        </td>
                                                        <td>
                                                            <a href="{{ route('swhatwes.show' , $whatwe->id) }}" >
                                                                View
                                                            </a>


                                                        </td> --}}
                                                        {{-- <th>
                                                            {{  $whatwe->created_at->format('Y-m-d')}}
                                                        </th> --}}
                                                            <td>
                                                                    <form action="{{route('news.destroy' , $whatwe->id)}}" method="post" id="form-{{$whatwe->id}}">
                                                                        {{csrf_field()}}
                                                                        {{method_field("DELETE")}}
                                                                    </form>

                                                                    <a href="{{ route('news.edit' , $whatwe->id) }}" ><i class="fas fa-edit"></i></a>

                                                                    &nbsp;
                                                                                   <a href=""
                                                                       onclick="if(confirm('Are you sure to delete?')) {
                                                                               event.preventDefault();
                                                                               document.getElementById('form-{{$whatwe->id}}').submit();
                                                                               }else{ event.preventDefault(); }"
                                                                       ><i class="fas fa-trash-alt"></i></a>
                                                                </td>


                                                    </tr>

                                                    @endforeach

                                                </table>

                                                <br>
                                                        <br>
                                                        <div class="container">
                                                            <div class="row justify-content-center">
                                                            {{ $WhatWes->links() }}
                                                        </div>
                                                        </div>

                                                        <br>
                                                        <br>
                                                        <br>

                                                </div>

                                            </div>

                                        </div>

                                    </div>
                                </div>
                                <!-- end card -->
                            </div> <!-- end col -->
                        </div> <!-- end row -->



                    </div>
                    <!-- container-fluid -->
                </div>
                <!-- End Page-content -->



@endsection

