dd
dd(CourseBundle::with('courses')->get()->toArray());
<?phpnamespace App\Models;use Illuminate\Database\Eloquent\Factories\HasFactory;use Illuminate\Database\Eloquent\Model;use Illuminate\Database\Eloquent\Relations\BelongsToMany;class CourseBundle extends Model{ use HasFactory; protected $guarded = ['id']; public function courses(): BelongsToMany { return $this->belongsToMany(Course::class, 'course_course_bundles', 'course_bundle_id', 'course_id') ->withTimestamps(); }}
<script>const fetchProduct = async () => { loadingProduct.value = true; const { productSlug } = route.params; const data = await $fetch(`/products/${productSlug}`, { baseURL: config.public.apiBaseUrl, }); product.value = data.product; otherProducts.value = data.otherProducts; loadingProduct.value = false;};onMounted(async () => await fetchProduct());</script>
ssr: false