Project
class Project extends Model
Traits
Methods
Scope a query to all projects that the user and the volume with the given ID have in common.
Scope a query to all projects that are accessible by a user.
The members of this project. Every member has a project-specific
project_role besides their global user role.
All members of this project with the admin role.
All members of this project with the editor role.
All members of this project with the guest role.
The user that created this project. On creation this user is automatically added to the project's users with the 'admin' role by the ProjectObserver.
The project invitations of this project.
Adds the user with the given role to this project.
Changes the role of an existing user in this project.
Determines if the user can be removed from the project.
Removes the user by ID from this project.
The volumes of this project.
The image volumes of this project.
The video volumes of this project.
The pending volumes of this project.
Detaches the volume from this project. Fails if this is the last
project, the volume is attached to, unless force is true.
Detaches all volumes from this project. Fails if this is the last
project, one of the volumes is attached to, unless force is true.
The label trees, this project is using.
The private label trees that authorized this project to use them.
URL to a unique thumbnail image for this project.
Check if the project has volumes which have some images with GPS coordinates.
Flush the cached information if this project has volumes which have images with GPS coordinates.
Details
at line 32
Builder
scopeInCommon(Builder $query, User $user, int $volumeId, Role|int> $roles = null)
Scope a query to all projects that the user and the volume with the given ID have in common.
at line 52
Builder
scopeAccessibleBy(Builder $query, User $user)
Scope a query to all projects that are accessible by a user.
at line 70
User, $this>
users()
The members of this project. Every member has a project-specific
project_role besides their global user role.
at line 81
User, $this>
admins()
All members of this project with the admin role.
at line 91
User, $this>
editors()
All members of this project with the editor role.
at line 101
User, $this>
guests()
All members of this project with the guest role.
at line 113
User, $this>
creator()
The user that created this project. On creation this user is automatically added to the project's users with the 'admin' role by the ProjectObserver.
at line 123
ProjectInvitation, $this>
invitations()
The project invitations of this project.
at line 135
void
addUserId(int $userId, Role|int $role)
Adds the user with the given role to this project.
at line 147
void
changeRole(int $userId, Role|int $role)
Changes the role of an existing user in this project.
at line 158
bool
userCanBeRemoved(int $userId)
Determines if the user can be removed from the project.
at line 169
bool
removeUserId(int $userId)
Removes the user by ID from this project.
at line 183
Volume, $this>
volumes()
The volumes of this project.
at line 193
Volume, $this>
imageVolumes()
The image volumes of this project.
at line 203
Volume, $this>
videoVolumes()
The video volumes of this project.
at line 213
PendingVolume, $this>
pendingVolumes()
The pending volumes of this project.
at line 225
void
addVolumeId(int $id)
deprecated
deprecated
Adds a volume to this project if it wasn't already.
at line 240
removeVolume(Volume $volume, bool $force = false)
Detaches the volume from this project. Fails if this is the last
project, the volume is attached to, unless force is true.
at line 265
removeAllVolumes(bool $force = false)
Detaches all volumes from this project. Fails if this is the last
project, one of the volumes is attached to, unless force is true.
at line 288
LabelTree, $this>
labelTrees()
The label trees, this project is using.
at line 298
LabelTree, $this>
authorizedLabelTrees()
The private label trees that authorized this project to use them.
at line 308
string
getThumbnailUrlAttribute()
URL to a unique thumbnail image for this project.
at line 329
bool
hasGeoInfo()
Check if the project has volumes which have some images with GPS coordinates.
at line 341
flushGeoInfoCache()
Flush the cached information if this project has volumes which have images with GPS coordinates.