@extends('layouts.app')


@section('content')
<div class="container">
    <div class="row">
        <div class="col-lg-12 mb-3">
            <div class="pull-left">
                <h2>outfits</h2>
            </div>
            <div class="pull-right">
            @can('outfit-create')
                <a class="btn btn-success" href="{{ route('outfits.create') }}"> Create New outfit</a>
            @endcan
            </div>
        </div>
    </div>


    @if ($message = Session::get('success'))
        <div class="alert alert-success">
            <p>{{ $message }}</p>
        </div>
    @endif


    <table class="table table-bordered">
        <tr>
            <th>No</th>
            <th>Nama</th>
            <th>Gambar</th>
            <th>Harga</th>
            <th>Stok</th>
            <th>Details</th>
            <th width="280px">Action</th>
        </tr>
	    @foreach ($outfits as $outfit)
	    <tr>
	        <td>{{ ++$i }}</td>
	        <td>{{ $outfit->nama }}</td>
	        <td>{{ $outfit->gambar }}</td>
	        <td>{{ $outfit->harga }}</td>
	        <td>{{ $outfit->stok }}</td>
	        <td>{{ $outfit->detail }}</td>
	        <td>
                <form action="{{ route('outfits.destroy',$outfit->id) }}" method="POST">
                    <a class="btn btn-info" href="{{ route('outfits.show',$outfit->id) }}">Show</a>
                    @can('outfit-edit')
                    <a class="btn btn-primary" href="{{ route('outfits.edit',$outfit->id) }}">Edit</a>
                    @endcan


                    @csrf
                    @method('DELETE')
                    @can('outfit-delete')
                    <button type="submit" class="btn btn-danger">Delete</button>
                    @endcan
                </form>
	        </td>
	    </tr>
	    @endforeach
    </table>
</div>

    {!! $outfits->links() !!}

@endsection