You've already forked Atomcms-edit
20 lines
442 B
PHP
Executable File
20 lines
442 B
PHP
Executable File
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Services\Community;
|
|
|
|
use App\Models\Miscellaneous\CameraWeb;
|
|
|
|
readonly class CameraService
|
|
{
|
|
public function fetchPhotos(bool $paginate = false, int $perPage = 8): mixed
|
|
{
|
|
$photos = CameraWeb::query()->where('visible', true)
|
|
->latest('id')
|
|
->with('user:id,username,look');
|
|
|
|
return $paginate ? $photos->paginate($perPage) : $photos->get();
|
|
}
|
|
}
|