@extends('layouts.app')

@section('content')
<div class="panel panel-default">
    <div class="panel-heading">Xero customers</div>
    

    <div class="panel-body">
       	<form method="post" action="{{ route('xero-customers.search')}}" >
	    <input type="hidden" value="{{csrf_token()}}" name="_token" />
	        <div class="form-group">
	            <label for="title">Search by name or account number:</label>
	            <input type="text" class="form-control" name="search" v/>
	        </div>
	         <button type="submit" class="btn btn-primary">search</button>
	     </form>

        <table class="table">
			@foreach( $xeroCustomers as $customer )
				<tr>
					
					<td>
						<a href="{{ route('xero-customers.show',$customer->id)}}">{{$customer->xero_name}}</a>
					</td>
					<td>
						{{$customer->email}}
					</td>
					<td>
						{{$customer->xero_account_number}}
					</td>
					<td>
						<a class="btn btn-primary" href="{{ route('xero-customers.edit',$customer->id)}}">Edit</a>
					</td>
				</tr>
			@endforeach
		</table>

		<?php echo $xeroCustomers->render(); ?>
    </div>
</div>
@endsection