*/ protected $fillable = [ 'account_id', 'name', 'type', 'can_be_deleted', 'reserved_to_contact_information', 'pagination', ]; /** * The attributes that should be cast to native types. * * @var array */ protected $casts = [ 'can_be_deleted' => 'boolean', 'reserved_to_contact_information' => 'boolean', ]; /** * Get the account associated with the template. */ public function account(): BelongsTo { return $this->belongsTo(Account::class); } /** * Get the module rows associated with the module. */ public function rows(): HasMany { return $this->hasMany(ModuleRow::class); } /** * Get the template pages associated with the module. */ public function templatePages(): BelongsToMany { return $this->belongsToMany(TemplatePage::class, 'module_template_page') ->withTimestamps(); } }