{{-- Task: add a condition to show correct text --}}
{{-- If user is logged in, show their email --}}
- Yes, I am logged in as [insert_user_email_here].
- No, I am not logged in.
+ @auth
+ Yes, I am logged in as {{ auth()->user()->email }}.
+ @endauth
+ @guest
+ No, I am not logged in.
+ @endguest
- {{-- Task: change the layout from layouts/app.blade.php --}}
- {{-- to layouts/main.blade.php --}}
- Please change layout.
-
+@extends('layouts.main')
+
+
+
+
+ Task: change the layout from layouts/app.blade.php
+ to layouts/main.blade.php
+ Please change layout.
-
+
+
diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php
index 9da21478..282cefd2 100644
--- a/resources/views/layouts/app.blade.php
+++ b/resources/views/layouts/app.blade.php
@@ -6,7 +6,7 @@
{{-- Task: edit one file to pass $metaTitle as "Blade Test" to all views --}}
- {{ $metaTitle ?? 'Laravel' }}
+ {{ $metaTitle ?? 'Blade Test' }}
diff --git a/resources/views/rows.blade.php b/resources/views/rows.blade.php
index 4762a090..6ad3847f 100644
--- a/resources/views/rows.blade.php
+++ b/resources/views/rows.blade.php
@@ -11,24 +11,32 @@
-
-
Row Number
-
Name
-
Email
-
Registered at
-
+
+
Row Number
+
Name
+
Email
+
Registered at
+
- @foreach ($users as $user)
- {{-- Task: only every second row should have "bg-red-100" --}}
+ @foreach ($users as $index=>$user)
+ {{-- Task: only every second row should have "bg-red-100" --}}
+ @if($index % 2 == 0)
-
{{-- Task: add row number here: 1, 2, etc. --}}
+ @else
+
+ @endif
+
{{-- Task: add row number here: 1, 2, etc. --}} {{$index}}
{{ $user->name }}
{{-- Task: only the FIRST row should have email with "font-bold" --}}
-