Files
project/resources/views/dashboard.blade.php
2025-01-15 10:31:30 +01:00

48 lines
2.1 KiB
PHP

@php
$customers = \App\Models\Customer::doesntHave('address')->get();
$invoices = \App\Models\Invoice::where('status', '=', 'created')->orderBy('created_at')->get();
@endphp
<x-app-layout>
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
{{ __('dashboard.Dashboard') }}
</h2>
</x-slot>
<div class="py-12">
<div class="max-w mx-auto sm:px-6 lg:px-8 grid grid-cols-4 gap-4">
<!-- Customers without address -->
<div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg col-span-2">
<div class="p-6 text-gray-900 dark:text-gray-100">
<h2 class="mb-4 text-lg font-medium text-gray-900 dark:text-gray-100">{{ __('dashboard.Customers without address') }}</h2>
@foreach($customers as $customer)
<a href="{{ route('customer.edit', $customer->id) }}"
class="flex max-w even:bg-gray-100 odd:bg-white">
<div class="w-1/2">{{ $customer->name }}</div>
<div class="w-1/2">{{ $customer->email }}</div>
</a>
@endforeach
</div>
</div>
<!-- Invoices not sent -->
<div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg col-span-2">
<div class="p-6 text-gray-900 dark:text-gray-100">
<h2 class="mb-4 text-lg font-medium text-gray-900 dark:text-gray-100">{{ __('dashboard.Invoices not sent') }}</h2>
@foreach($invoices as $invoice)
<a href="{{ route('invoice.edit', $invoice->id) }}"
class="flex max-w even:bg-gray-100 odd:bg-white">
<div class="w-1/2">{{ $invoice->number }}</div>
<div class="w-1/2">{{ $invoice->address->name }}</div>
</a>
@endforeach
</div>
</div>
</div>
</div>
</x-app-layout>