@extends('layouts.app')
@section('title', __('nav.companies'))
@section('content')
<div class="d-flex justify-content-between mb-3"><h1 class="h4">{{ __('nav.companies') }}</h1>@can('companies.create')<a class="btn btn-success" href="{{ route('companies.create') }}">{{ __('messages.create') }}</a>@endcan</div>
<form class="mb-3"><input class="form-control" name="q" value="{{ request('q') }}" placeholder="{{ __('messages.search') }}"></form>
<div class="card"><div class="table-responsive"><table class="table mb-0">
<thead><tr><th>{{ __('messages.name') }}</th><th>{{ __('messages.code') }}</th><th>{{ __('messages.phone') }}</th><th>{{ __('messages.status') }}</th><th></th></tr></thead>
<tbody>
@forelse($companies as $c)
<tr><td><a href="{{ route('companies.show',$c) }}">{{ $c->name }}</a></td><td>{{ $c->code }}</td><td>{{ $c->phone }}</td><td>{{ $c->status->label() }}</td><td>@can('companies.edit')<a href="{{ route('companies.edit',$c) }}">{{ __('messages.edit') }}</a>@endcan</td></tr>
@empty<tr><td colspan="5">{{ __('messages.no_results') }}</td></tr>@endforelse
</tbody></table></div><div class="card-body">{{ $companies->links() }}</div></div>
@endsection
