File: /home/posscale/public_html/printmanager/resources/views/tenant/customers/show.blade.php
<x-app-layout>
<x-slot name="header">
<h1 class="mb-0 uppercase text-3xl ">
{{ __('Customer Details') }}
</h1>
</x-slot>
@if(session()->has('message'))
<div class="alert alert-success text-white p-4 bg-green-900 font-semibold text-l mb-8">
{{ session()->get('message') }}
</div>
@endif
<div class="grid grid-cols-1">
<div class="card">
<div class="card-header flex justify-between">
<h3 class="card-title uppercase">
{{ __('Customer Details') }}
</h3>
<a href="{{route('customers.index')}}" class="btn btn-primary w-max uppercase">Back</a>
</div>
<div class="card-body">
<table class="table">
<tr>
<td width="150"><strong>Name: </strong></td>
<td>{{ $customer->name}}</td>
</tr>
<tr>
<td ><strong>Email: </strong></td>
<td>{{ $customer->email}}</td>
</tr>
<tr>
<td ><strong>Phone: </strong></td>
<td>{{ $customer->phone}}</td>
</tr>
</table>
</div>
</div>
</div>
<div class="grid grid-cols-1 mt-5">
<div class="card">
<div class="card-header flex justify-between">
<h3 class="card-title uppercase">
{{ __('Customer Address') }}
</h3>
<a href="{{ route('address.create', $customer->id) }}" class="btn btn-primary w-max uppercase">Add new</a>
</div>
<div class="card-body">
<table class="table">
<thead>
<tr class="">
<th class="text-left">Address</th>
<th class="text-left">City</th>
<th class="text-left">State</th>
<th class="text-left">ZIP</th>
<th class="text-right">Action</th>
</tr>
</thead>
<tbody >
@forelse($customer->addresses()->get() as $address)
<tr class="">
<td class="py-4">{{ $address->address }}</td>
<td class="py-4">{{ $address->city }}</td>
<td class="py-4">{{ $address->state }}</td>
<td class="py-4">{{ $address->zip }}</td>
<td class="py-4 w-80 text-white text-right">
<a href="{{ route('address.edit',[$customer->id, $address->id])}}" class="text-[#ffffff] border rounded border-[#ffffff] inline-block mr-2 font-medium p-2 hover:bg-[#3b82f6] hover:text-white">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-4 h-4 inline-block mr-1">
<path d="M21.731 2.269a2.625 2.625 0 0 0-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 0 0 0-3.712ZM19.513 8.199l-3.712-3.712-12.15 12.15a5.25 5.25 0 0 0-1.32 2.214l-.8 2.685a.75.75 0 0 0 .933.933l2.685-.8a5.25 5.25 0 0 0 2.214-1.32L19.513 8.2Z" />
</svg>
EDIT
</a>
<a x-data href="javascript:void(0);" class="text-[#ffffff] border rounded border-[#ffffff] inline-block mr-2 font-medium p-2 hover:bg-[#3b82f6] hover:text-white" @click="$dispatch('open-delete', { url: '{{route('address.destroy', [$customer->id, $address->id])}}' })">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-4 h-4 inline-block">
<path fill-rule="evenodd" d="M16.5 4.478v.227a48.816 48.816 0 0 1 3.878.512.75.75 0 1 1-.256 1.478l-.209-.035-1.005 13.07a3 3 0 0 1-2.991 2.77H8.084a3 3 0 0 1-2.991-2.77L4.087 6.66l-.209.035a.75.75 0 0 1-.256-1.478A48.567 48.567 0 0 1 7.5 4.705v-.227c0-1.564 1.213-2.9 2.816-2.951a52.662 52.662 0 0 1 3.369 0c1.603.051 2.815 1.387 2.815 2.951Zm-6.136-1.452a51.196 51.196 0 0 1 3.273 0C14.39 3.05 15 3.684 15 4.478v.113a49.488 49.488 0 0 0-6 0v-.113c0-.794.609-1.428 1.364-1.452Zm-.355 5.945a.75.75 0 1 0-1.5.058l.347 9a.75.75 0 1 0 1.499-.058l-.346-9Zm5.48.058a.75.75 0 1 0-1.498-.058l-.347 9a.75.75 0 0 0 1.5.058l.345-9Z" clip-rule="evenodd" />
</svg>
DELETE
</a>
</td>
</tr>
@empty
<tr>
<td class="border-b border-slate-100 dark:border-slate-700 p-4 pl-8 text-slate-500" colspan="4">No printer found</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
<div x-data="{ open: false, url:'' }">
<div @open-delete.window="url=$event.detail.url;open=true;" @keydown.escape.window="open = false" class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" x-show="open" style="display: none" x-cloak>
<!-- Modal -->
<div class="flex items-center justify-center min-h-screen">
<div class="bg-white p-6 rounded-lg overflow-hidden shadow-xl transform transition-all sm:max-w-lg sm:w-full" @click.away="open = false" x-transition:enter="ease-out duration-100" x-transition:enter-start="opacity-0" x-transition:enter-end="opacity-100 scale-100" x-transition:leave="ease-in duration-200" x-transition:leave-start="opacity-100 scale-100" x-transition:leave-end="opacity-0">
<!-- Modal header -->
<div class="flex items-start justify-between">
<div class="text-left">
<h3 class="text-lg leading-6 font-medium text-black">Are you sure, Want to delete the address?</h3>
</div>
<span class="cursor-pointer" @click="open = false">✕</span>
</div>
<div class="mt-0 mb-10">
<p class="text-sm text-red-700">
After deleting address, You will not able to restore it.
</p>
</div>
<!-- Modal footer -->
<div class="flex items-center justify-start gap-2 mt-10">
<button type="button" class="w-full btn btn-primary uppercase sm:w-auto" @click="open = false">
Cancel
</button>
<form x-bind:action="url" method="POST">
@csrf
@method('DELETE')
<button type="submit" class="w-full btn btn-error uppercase">
Delete
</button>
</form>
</div>
</div>
</div>
</div>
</div>
<?php /*<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg mt-6">
<div class="shadow-sm overflow-hidden">
<div class="p-4">
<table class="border-collapse table-auto w-full text-sm">
<thead>
<tr class="uppercase text-sm font-medium text-gray-900 text-slate-700 font-semibold">
<th class="border-b pb-4 text-center">#</th>
<th class="border-b pb-4 text-left">Meter Date</th>
<th class="border-b pb-4 text-center">Printed Pages</th>
<th class="border-b pb-4 text-center">Scanned Pages</th>
</tr>
</thead>
<tbody>
@foreach($jobs as $job)
<tr class="text-slate-500 odd:bg-white even:bg-slate-100 border-slate-100">
<td class="p-4 text-center text-blue-500"><a href="{{route('job_details', $job->id)}}"> {{ $job->id }}</a></td>
<td class="py-4">{{ isset($job)?$job->mail_date:'-'}}</td>
<td class="py-4 text-center">{{ isset($job)?$job->printed_total:'-'}}</td>
<td class="py-4 text-center">{{ isset($job)?$job->scanned_total:'-'}}</td>
</tr>
@endforeach
</tbody>
</table>
<div class="mt-6 my-12">
{{ $jobs->links() }}
</div>
</div>
</div>
</div> */ ?>
</x-app-layout>