Register the remaining YAML admin screens and the settings singleton so a host can boot Posts, Categories, Tags, and Code journal. Posts update and delete refuse other authors without access_other_posts. Co-authored-by: Cursor <cursoragent@cursor.com>
34 lines
840 B
Go
34 lines
840 B
Go
package models
|
|
|
|
import "time"
|
|
|
|
// Tag is a journal tag stored on golem15_journal_tags. It is not translatable.
|
|
type Tag struct {
|
|
ID uint `gorm:"column:id;primaryKey"`
|
|
Name string `gorm:"column:name"`
|
|
Slug string `gorm:"column:slug"`
|
|
Description *string `gorm:"column:description"`
|
|
CreatedAt *time.Time `gorm:"column:created_at"`
|
|
UpdatedAt *time.Time `gorm:"column:updated_at"`
|
|
}
|
|
|
|
func (Tag) TableName() string { return "golem15_journal_tags" }
|
|
|
|
func (Tag) MorphName() string { return `Golem15\Journal\Models\Tag` }
|
|
|
|
// Fillable is JOURNAL-001.
|
|
func (Tag) Fillable() []string {
|
|
return []string{"name", "slug", "description"}
|
|
}
|
|
|
|
func (Tag) Rules() map[string]string {
|
|
return map[string]string{
|
|
"name": "required",
|
|
"slug": "required|between:3,64",
|
|
}
|
|
}
|
|
|
|
func init() {
|
|
Register(Tag{})
|
|
}
|