So here is my controller:
$topics = Topic::where('board_id', $id)->with('user')->get(); $topic = Topic::find($id); $board = Boards::where('id', $id)->get(); return view('boards.show')->with('topics', $topics)->with('topic', $topic)->with('board', $board);
And here is the code for generating the urls:
@foreach($board as $boards) <a href="/topics/create/{{$boards->id}}">Create New Post</a> <p>No Posts Found</p> @endforeach
But if I delete the foreach loop, it gives an error:
Property [id] does not exist on this collection instance.
But why, should I go in cycles if it only receives one line from the table of payments? Any solution to do this without starting for each cycle ???
source share