<table>
    <thead>
    <tr>
        @if($user->disabledColumn('title','deals'))
            <th scope="col">{{ __('deals.title') }}</th>
        @endif
        @if($user->disabledColumn('description','deals'))
            <th scope="col">{{ __('deals.description') }}</th>
        @endif
        @if($user->disabledColumn('start_date','deals'))
            <th scope="col">{{ __('deals.start_date') }}</th>
        @endif
        @if($user->disabledColumn('end_date','deals'))
            <th scope="col">{{ __('deals.end_date') }}</th>
        @endif
        @if($user->disabledColumn('employee_id','deals'))
            <th scope="col">{{ __('deals.employee_id') }}</th>
        @endif
        @if($user->disabledColumn('product_id','deals'))
            <th scope="col">{{ __('deals.product_id') }}</th>
        @endif
        @if($user->disabledColumn('contact_list_id','deals'))
            <th scope="col">{{ __('deals.contact_list_id') }}</th>
        @endif
        @if($user->disabledColumn('company_id','deals'))
            <th scope="col">{{ __('deals.company_id') }}</th>
        @endif
        @if($user->disabledColumn('status','deals'))
            <th scope="col">{{ __('deals.status') }}</th>
        @endif
        @if($user->disabledColumn('amount','deals'))
            <th scope="col">{{ __('deals.amount') }}</th>
        @endif
        @if($user->disabledColumn('month','deals'))
            <th scope="col">{{ __('deals.month') }}</th>
        @endif
        @if($user->disabledColumn('created_at','deals'))
            <th scope="col" >{{ __('dashboard.created_at') }}</th>
        @endif
    </tr>
    </thead>
    <tbody class="response">
    @foreach($deals as $key=> $row)
        <tr>
            @if($user->disabledColumn('title','deals'))
                <td>{{ $row->title }}</td>
            @endif
            @if($user->disabledColumn('description','deals'))
                <td>{{ $row->description }}</td>
            @endif
            @if($user->disabledColumn('start_date','deals'))
                <td>{{ $row->start_date }}</td>
            @endif
            @if($user->disabledColumn('end_date','deals'))
                <td>{{ $row->end_date }}</td>
            @endif
            @if($user->disabledColumn('employee_id','deals'))
                <td>{{ $row->employee->name ?? '' }}</td>
            @endif
            @if($user->disabledColumn('product_id','deals'))
                <td>{{ $row->product->currentDescription->title ?? '' }}</td>
            @endif
            @if($user->disabledColumn('contact_list_id','deals'))
                <td>{{ $row->contactList->currentDescription->title ?? '' }}</td>
            @endif
            @if($user->disabledColumn('company_id','deals'))
                <td>{{ $row->company->currentDescription->title ?? '' }}</td>
            @endif
            @if($user->disabledColumn('status','deals'))
                <td>{{ __('deals.statuses.'.$row->status) }}</td>
            @endif
            @if($user->disabledColumn('amount','deals'))
                <td>{{ $row->amount }}</td>
            @endif
            @if($user->disabledColumn('month','deals'))
                <td>{{ __('deals.months.'.$row->month) }}</td>
            @endif
            @if($user->disabledColumn('created_at','deals'))
                <td>{{ \Carbon\Carbon::parse($row->created_at)->format('Y/m/d') }}</td>
            @endif
        </tr>
    @endforeach
    </tbody>
</table>

