initial: bootstrap from BukidBountyApp base

This commit is contained in:
Jonathan Sykes
2026-06-06 18:43:00 +08:00
commit eb4a5731fb
5674 changed files with 160857 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
<?php
declare(strict_types=1);
namespace App\Http\Controllers\Photos;
use App\Models\Market\Product;
use App\Models\Market\Store;
use App\Models\User;
use Hypervel\Http\Request;
class PhotoGallery
{
public function handle(Request $request, string $type)
{
$hash = $request->input('target', false);
// Validate inputs
if (!$type) {
return response()->json(false);
}
if (!$hash || is_numeric($hash)) {
return response()->json(false);
}
$photoUrls = null;
switch ($type) {
// case 'ProductMarket':
// // Assuming you have a helper function RequestPhotos($hash, $type)
// $result = RequestPhotos($hash, $type);
// return response()->json($result);
case 'User':
$photoUrls = User::where('hashkey', $hash)
->value('photourl') ?? false;
break;
case 'StoreMarket':
$photoUrls = Store::where('hashkey', $hash)->value('photourl') ?? false;
break;
case 'ProductMarket':
$photoUrls = Product::where('hashkey', $hash)->value('photourl') ?? false;
break;
default:
return response()->json(false);
}
if (!$photoUrls) {
return response()->json(false);
}
// $decoded = tryjsondecode($photoUrls);
return response()->json($photoUrls);
}
}