0
我正在使用Laravel 3並希望在我的模型中使用Sentry :: user作爲$ include,但它不會讓我。到目前爲止,我已經在$ include中嘗試了「Sentry :: user」,導致「ap $ iw {u []」。我也嘗試過「sentry.user」,但這意味着一個哨兵模型(我沒有)和用戶關係。在模型中使用Laravel包
所以爲了讓這個問題對其他人也有價值:你如何在自己的Laravel 3模型中包含一個模型包?
<?php
public $includes = array('company', '??');
public function company() {
return $this->belongs_to('Company');
}
public function user() {
return $this->belongs_to('Sentry::user');
}
?>