This repository has been archived by the owner on Oct 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f280104
commit 2762c62
Showing
3 changed files
with
54 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
@extends('components.layouts.app') | ||
|
||
@section('content') | ||
<main class="container grid grid-cols-1 gap-4 p-8"> | ||
@foreach ($users as $user) | ||
<article class="relative flex justify-between rounded-md bg-base-200/50 px-8 py-4 shadow"> | ||
<div> | ||
<div>{{ $user->name }}</div> | ||
<div>{{ $user->email }}</div> | ||
</div> | ||
|
||
<button popovertarget="popover-{{ $user->id }}" class="hover:text-primary">Ver pets</button> | ||
<div id="popover-{{ $user->id }}" popover | ||
class="w-[min(100vw-2rem,600px)] rounded-xl bg-base-200/50 p-12 shadow" | ||
> | ||
@foreach ($user->pets as $pet) | ||
<div class="flex flex-col justify-between"> | ||
<h2 class="text-lg font-bold">Dados do pet</h2> | ||
<div>Nome: {{ $pet->name }}</div> | ||
<div>Nascimento: {{ $pet->born }}</div> | ||
<div>Tipo: {{ $pet->type }}</div> | ||
|
||
@if (!empty($pet->vaccines) && $pet->vaccines !== '_' && $pet->vaccines) | ||
@php | ||
$vaccines = explode(',', $pet->vaccines); | ||
@endphp | ||
@if (count($vaccines) > 1) | ||
<h2 class="mt-8 text-lg font-bold">Vacinas</h2> | ||
<div> | ||
@foreach ($vaccines as $vaccine) | ||
@php | ||
[$name, $date] = explode('-', $vaccine); | ||
@endphp | ||
<div class="flex items-center"> | ||
<div class="mr-2">{{ $name }}</div> | ||
<div>{{ $date }}</div> | ||
</div> | ||
@endforeach | ||
</div> | ||
@endif | ||
@endif | ||
</div> | ||
@endforeach | ||
</div> | ||
</article> | ||
@endforeach | ||
</main> | ||
@endsection |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
<?php | ||
|
||
use App\Models\Pet; | ||
use App\Models\User; | ||
use Illuminate\Support\Facades\Route; | ||
|
||
Route::get('/', function () { | ||
return view('welcome'); | ||
return view('home', [ | ||
'users' => User::all(), | ||
'petQuantity' => Pet::has('user')->count(), | ||
]); | ||
}); |