class CreditRule extends Model
{
protected $fillable = array(
'department_id',
'created_by',
'updated_by'
);
public function department()
{
return $this->belongsTo('App\Department');
}
我的 Controller 是
$creditRules = CreditRule::get();
最佳答案
你的意思是类似
CreditRule::find(1);
这将为模型 CreditRule 检索 id=1 的行。
关于html - 如何从表中选择一行,其模型具有功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35693698/