EG
Size: a a a
EG
VY
EG
VY
EG
VY
EG
VY
EG
EG
VY
EG
VY
public function books()
{
return $this->belongsToMany('App\Book');
}
public function authors()
{
return $this->belongsToMany('App\Author');
}
public function show(Author $author)
{
// $model = Author::find($author->id)->with('books');
$model = $author->books();
dd($model);
return view('library.author.show', ['author' => $model]);
}
EG
public function books()
{
return $this->belongsToMany('App\Book');
}
public function authors()
{
return $this->belongsToMany('App\Author');
}
public function show(Author $author)
{
// $model = Author::find($author->id)->with('books');
$model = $author->books();
dd($model);
return view('library.author.show', ['author' => $model]);
}
{```
return view('library.author.show', ['author' => $author]);
}
VY
{```
return view('library.author.show', ['author' => $author]);
}
AP
$model = $author->books();
в dd($model);
вижу, что запрос нормально выполнился, но не могу вытащить из результата - автора, хотя он там есть :)$author->name
не то..., как казалось бы должно быть...AP
AP
AP
AP