我有两个型号Shelf,Book and Quote
class Shelf extends Eloquent {
public function quotes()
{
return $this->belongsToMany('Book');
}
}
class Book extends Eloquent {
protected $touches = array('shelfs');
public function quotes()
{
return $this->belongsToMany('Quote');
}
public function shelfs()
{
return $this->belongsToMany('Shelf');
}
}
class Quote extends Eloquent {
protected $touches = array('books');
public function books()
{
return $this->belongsToMany('Book')->withTimestamps();
}
}
当我更新Qoute模型时,Qout模型表中的updated_at被更新,但是架子模型没有更新。
我做错了吗? 提前谢谢