Support the ongoing development of Laravel.io →
Database Eloquent Blade
Last updated 7 months ago.
0

@sabina2nistor: Problem with blade file so place your blade file code too.

0

check your View

0

You might have to include the field names that the tables join on as the second and third parameters of belongsTo and hasMany functions. I had a similar issue because my table was named categories and my column in the other table was named category_id, not categories_id. Once I included the field names to join on it worked.

0

What parameters did you include smspear?>smspear

0

AddWebSolution said:

@sabina2nistor: Problem with blade file so place your blade file code too.@extends('main')

@section('title','| $post->title ')

@section('content')

<div class="row"> <div class="col-md-8"> <h2>{{ $post->title }}</h2> <p>{{ $post->body }}</p> <hr> <p>Category: {{$post->category->name}}</p> </div> </div>

@endsection

this is view file . p.s em not the questioner but answer seeker

0

create controllers and return it to view

0

Sign in to participate in this thread!

Cloudways

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.