Add Events-style heroes to Storefronts and Products index pages.
Deploy Ladill Merchant / deploy (push) Successful in 42s
Deploy Ladill Merchant / deploy (push) Successful in 42s
Surface wallet balance and key counts in gradient hero sections so Merchant list pages match the Events pattern. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Merchant;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Crm\CrmClient;
|
||||
use App\Services\Qr\QrCodeManagerService;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
@@ -14,6 +15,8 @@ use Illuminate\View\View;
|
||||
*/
|
||||
class ProductController extends Controller
|
||||
{
|
||||
public function __construct(private QrCodeManagerService $manager) {}
|
||||
|
||||
private function crm(): CrmClient
|
||||
{
|
||||
return CrmClient::for((string) ladill_account()->public_id);
|
||||
@@ -29,9 +32,15 @@ class ProductController extends Controller
|
||||
'search' => $search !== '' ? $search : null,
|
||||
]);
|
||||
|
||||
$products = (array) ($response['data'] ?? []);
|
||||
$wallet = $this->manager->walletFor(ladill_account());
|
||||
|
||||
return view('merchant.products.index', [
|
||||
'products' => (array) ($response['data'] ?? []),
|
||||
'products' => $products,
|
||||
'search' => $search,
|
||||
'wallet' => $wallet,
|
||||
'productCount' => count($products),
|
||||
'activeCount' => collect($products)->filter(fn ($p) => ($p['active'] ?? true))->count(),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user