This commit is contained in:
apuc committed 2025-01-19 17:15:58 +03:00
1 parent 40369fb515
commit b18378bcb1
41 files changed
+1257 -30

No files matched your search

+24
View File
@@ -2,7 +2,31 @@
namespace app\modules\photo;
use Illuminate\Database\Eloquent\Model;
use kernel\app_modules\photo\models\Photo;
class PhotoModule extends \kernel\app_modules\photo\PhotoModule
{
public function getItems(string $entity, Model $model): array|string
{
$photos = Photo::where("entity", $entity)->where("entity_id", $model->id)->get();
$photoArr = [];
foreach ($photos as $photo) {
$photoArr[] =$photo->image;
}
return $photoArr;
}
public function getItem(string $entity, string $entity_id): string
{
$photos = Photo::where("entity", $entity)->where("entity_id", $entity_id)->first();
if ($photos){
return $photos->image;
}
return "";
}
}