|
@@ -9,7 +9,26 @@ class Discussion extends Model
|
|
|
{
|
|
{
|
|
|
use HasFactory;
|
|
use HasFactory;
|
|
|
protected $primaryKey = 'id';
|
|
protected $primaryKey = 'id';
|
|
|
- protected $casts = [
|
|
|
|
|
- 'id' => 'string'
|
|
|
|
|
- ];
|
|
|
|
|
|
|
+ protected $casts = [
|
|
|
|
|
+ 'id' => 'string'
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ //批量填充
|
|
|
|
|
+ protected $fillable = [
|
|
|
|
|
+ 'res_id',
|
|
|
|
|
+ 'res_type',
|
|
|
|
|
+ 'type',
|
|
|
|
|
+ 'tpl_id',
|
|
|
|
|
+ 'title',
|
|
|
|
|
+ 'content',
|
|
|
|
|
+ 'content_type',
|
|
|
|
|
+ 'parent',
|
|
|
|
|
+ 'editor_uid',
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ // 设置默认值
|
|
|
|
|
+ protected $attributes = [
|
|
|
|
|
+ 'content_type' => 'markdown',
|
|
|
|
|
+ 'type' => 'discussion'
|
|
|
|
|
+ ];
|
|
|
}
|
|
}
|