*/ use HasFactory; /** * The attributes that are mass assignable. * * @var list */ protected $fillable = [ 'templates_node_id', 'name', ]; /** * Get the associated user. * * @return BelongsTo */ public function user(): BelongsTo { return $this->belongsTo(User::class, 'created_by'); } /** * Get the nodes for the vault. * * @return HasMany */ public function nodes(): HasMany { return $this->hasMany(VaultNode::class); } /** * Get the associated templates node. * * @return HasOne */ public function templatesNode(): HasOne { return $this->hasOne(VaultNode::class, 'id', 'templates_node_id'); } }