the blade views not rendering bootstrap table data and $members variable undefined despite being passed via compact()

2 days ago 6
ARTICLE AD BOX

All views use @extends('layouts.app') so Breeze handles the nav/design
It should look like these examples bro
services/index.blade.php

@extends('layouts.app') @section('content') @if(session('success')) <p>{{ session('success') }}</p> @endif <h1>Services</h1> <a href="{{ route('services.create') }}">+ Add Service</a> <table> <tr><th>#</th><th>Name</th><th>Price</th><th>Duration</th><th>Description</th><th>Actions</th></tr> @foreach($services as $i => $s) <tr> <td>{{ $i+1 }}</td><td>{{ $s->name }}</td><td>{{ $s->price }}</td> <td>{{ $s->duration }}</td><td>{{ $s->description }}</td> <td> <a href="{{ route('services.edit', $s) }}">Edit</a> <form action="{{ route('services.destroy', $s) }}" method="POST"> @csrf @method('DELETE') <button>Delete</button> </form> </td> </tr> @endforeach </table> @endsection

services/create.blade.php

@extends('layouts.app') @section('content') <h1>Add Service</h1> <form action="{{ route('services.store') }}" method="POST"> @csrf <input type="text" name="name" placeholder="Name"> <input type="number" name="price" placeholder="Price" step="0.01"> <input type="text" name="duration" placeholder="Duration"> <textarea name="description" placeholder="Description"></textarea> <button type="submit">Save</button> </form> @endsection

services/edit.blade.php

@extends('layouts.app') @section('content') <h1>Edit Service</h1> <form action="{{ route('services.update', $service) }}" method="POST"> @csrf @method('PUT') <input type="text" name="name" value="{{ $service->name }}"> <input type="number" name="price" value="{{ $service->price }}" step="0.01"> <input type="text" name="duration" value="{{ $service->duration }}"> <textarea name="description">{{ $service->description }}</textarea> <button type="submit">Update</button> </form> @endsection

bookings/create.blade.php (key part — the dropdown)

@extends('layouts.app') @section('content') <h1>New Booking</h1> <form action="{{ route('bookings.store') }}" method="POST"> @csrf <input type="text" name="customer_name" placeholder="Customer Name"> <select name="service_id"> <option value="">Select Service</option> @foreach($services as $s) <option value="{{ $s->id }}">{{ $s->name }} - ₱{{ $s->price }}</option> @endforeach </select> <input type="datetime-local" name="schedule"> <input type="number" name="price" placeholder="Price" step="0.01"> <button type="submit">Save</button> </form> @endsection

bookings/index.blade.php

@extends('layouts.app') @section('content') <h1>Bookings</h1> <a href="{{ route('bookings.create') }}">+ New Booking</a> <table> <tr><th>#</th><th>Customer</th><th>Service</th><th>Schedule</th><th>Price</th><th>Actions</th></tr> @foreach($bookings as $i => $b) <tr> <td>{{ $i+1 }}</td><td>{{ $b->customer_name }}</td> <td>{{ $b->service->name }}</td> <td>{{ $b->schedule }}</td><td>{{ $b->price }}</td> <td> <a href="{{ route('bookings.edit', $b) }}">Edit</a> <form action="{{ route('bookings.destroy', $b) }}" method="POST"> @csrf @method('DELETE') <button>Delete</button> </form> </td> </tr> @endforeach </table> @endsection

payments/create.blade.php

@extends('layouts.app') @section('content') <h1>Add Payment</h1> <form action="{{ route('payments.store') }}" method="POST"> @csrf <select name="booking_id"> <option value="">Select Booking</option> @foreach($bookings as $b) <option value="{{ $b->id }}">{{ $b->customer_name }} - {{ $b->service->name }}</option> @endforeach </select> <input type="number" name="amount" placeholder="Amount" step="0.01"> <select name="status"> <option value="Unpaid">Unpaid</option> <option value="Paid">Paid</option> </select> <button type="submit">Save</button> </form> @endsection

payments/index.blade.php

@extends('layouts.app') @section('content') <h1>Payments</h1> <a href="{{ route('payments.create') }}">+ Add Payment</a> <table> <tr><th>#</th><th>Customer</th><th>Service</th><th>Amount</th><th>Status</th><th>Actions</th></tr> @foreach($payments as $i => $p) <tr> <td>{{ $i+1 }}</td> <td>{{ $p->booking->customer_name }}</td> <td>{{ $p->booking->service->name }}</td> <td>{{ $p->amount }}</td><td>{{ $p->status }}</td> <td> <a href="{{ route('payments.edit', $p) }}">Edit</a> <form action="{{ route('payments.destroy', $p) }}" method="POST"> @csrf @method('DELETE') <button>Delete</button> </form> </td> </tr> @endforeach </table> @endsection

these should help you understand about the blades bro

Read Entire Article