So I'm using laravel, and I have a table with id, category_name, parent_id, desc, and url.
Then in the view, I foreach the table with this code:
@foreach($categories as $category)
<tr class="gradeX">
<td>{{ $category->id }}</td>
<td>{{ $category->name }}</td>
<td>{{ $category->parent_id }}</td>
<td>{{ $category->description }}</td>
<td>{{ $category->url }}</td>
<td class="center">
<a href="{{ url('/admin/edit-category/'.$category->id) }}" class="btn btn-primary btn-mini">Edit</a>
<a href="{{ url('/admin/delete-category/'.$category->id) }}" class="delCat btn btn-danger btn-mini">Delete</a>
</td>
</tr>
@endforeach
now, instead of showing parent_id, I want to show the parent category name. I've tried a lot of things but nothing work.
I know this might be a very easy question, but I'm just started learning web development by myself. So please bear with me.
Thank you.