I am confused. I want to display all loan data with a username to the table in the blade. This is my confusion :
This table I want to display in blade :
This is the table that i use :
This My Model User :
public function book(){
return $this->belongsToMany(Book::class, 'loans')->withPivot(['loan_date','status'])->withTimeStamps();
}
This My Book Model :
public function user(){
return $this->belongsToMany(User::class, 'loans')->withPivot(['loan_date','status'])->withTimeStamps();
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire