Комментарии:
very useful and helpful video thanks
ОтветитьCould you help me out, please!
I have TWO TABLES with relationship.
In my index method, I join them and compact the $real .
$real = DB::table('declarers')
->join ('estates','declarers.id','estates.item_id')
->get();
In my index view, I loop through the $real: @foreach ($real as $pr) and manage to display the data.
However, problem occurs with the Show button <a class="btn btn-info" href="{{ route('products.show',$pr->id) }}">Show</a>
As, this takes the ID of ONE TABLE only (the estates table).
And thus, in show method +show view, I can only display the information from the estates table.
What should I do to display the corresponding information from the declarers too?
I am looking forward to your advice, and thank you in advance!
Madam, i want to set a column name (p_id) instead of (id) what to do?
Ответитьmam in my case when the show function is running ,id is displayed on the URL when I m writing /studentresource/{{$n->id}} in the href,also the show function is being called (I have checked by returning a simple text ) but when I m returning the parameter I.e Student $student as return $student ,it is displaying an empty array.
Ответить