Edit: Added view code
Hey everyone, Can someone assist me with this problem?
// Start
WEB Code:
Route::get('/', [CatinController::class, 'home']);
Controller Code (CatinController):
public function home(Catin $catin) {
return view('home', [
'catins' => $catin
]);
}
Home View Code:
<x-layout-home>
@include('partials._hero')
</x-layout-home>
Component "layout-home" Code:
<body class="mb-48">
{{-- Navbar Component --}}
<x-navbar :catins="$catins" />
{{-- View Output --}}
<main>
{{$slot}}
</main>
<footer class="fixed bottom-0 left-0 w-full flex items-center justify-start font-bold bg-footer text-white h-24 mt-24 md:justify-center">
<p class="ml-2">Work in progress (WIP)</p>
<a
href="/catins/create"
class="border border-white absolute top-1/3 right-10 bg-black text-white py-2 px-5"
>
<i class="fa-solid fa-plus"></i> Tambah data calon pengantin
</a
>
</footer>
<x-flash-message />
</body>
</html>
"Navbar" Component Code:
@props(['catins'])
{{-- Error --}}
src="{{$catins->image ? asset('storage/' . $catins->image) : asset('/images/profile/no-image.jpg')}}"
alt="Rounded avatar">
</li>
MySQL table in the picture
// End
Any idea what's the issue? Previously I'm using auth()->user()->image because it's using the laravel default "User" Table, but it ended up throwing an error. And now i'm trying it by using props but still throws an error