'Фото', 'entity' => 'Сущность', 'entity_id' => 'Идентификатор сущности', ]; } public static function getPhotoListByEntity(string $entity): array { return self::where("entity", $entity)->get()->toArray(); } public static function getPhotoByEntity(string $entity): array { $result = []; $photos = self::getPhotoListByEntity($entity); foreach ($photos as $photo) { $result[$photo['id']] = $photo['label']; } return $result; } }