laravel访问器里面给其他属性赋值
class Post extends Model
{
public $is_truncation = false;
public function getSummaryAttribute()
{
$this->is_truncation = true;
......
}
}
这样操作可以
为什么要给别的属性赋值? 别的属性set不是可以吗 你的get里面有别的属性的set,不会被cto说吗?