feat: organisation logo (attachOne logo) and payload helpers

- Organisation gains the public attachOne logo (OrganisationLogoField),
  editable as an image upload on the Organisations form; avatar unchanged
- OrganisationLogoURL and OrganisationLogoFields give applications the
  has_logo, logo and logo_url keys for their organisation payloads
- no migration: attachments live in system_files
This commit is contained in:
Jakub Zych
2026-10-23 17:03:13 +02:00
parent ee5c096d0d
commit f20a8d3b98
8 changed files with 124 additions and 9 deletions

View File

@@ -34,9 +34,15 @@ func (Organisation) MorphName() string { return `Golem15\User\Models\Organisatio
// organisation's picture.
const OrganisationAvatarField = "avatar"
// AttachRelations declares the public attachOne avatar (PHP $attachOne).
// OrganisationLogoField is the attachOne relation name of the
// organisation's logo, the image a site shows wherever it displays the
// organisation.
const OrganisationLogoField = "logo"
// AttachRelations declares the public attachOne avatar (PHP $attachOne) and
// the public attachOne logo.
func (Organisation) AttachRelations() []attach.Relation {
return []attach.Relation{{Name: OrganisationAvatarField, Public: true}}
return []attach.Relation{{Name: OrganisationAvatarField, Public: true}, {Name: OrganisationLogoField, Public: true}}
}
// Fillable is the PHP $fillable list.