• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

conedevelopment / bazar / 20877983475

10 Jan 2026 12:02PM UTC coverage: 79.458% (-0.4%) from 79.824%
20877983475

push

github

iamgergo
add query string driver

7 of 19 new or added lines in 6 files covered. (36.84%)

1992 of 2507 relevant lines covered (79.46%)

37.07 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Cart/QueryStringDriver.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Cone\Bazar\Cart;
6

7
use Cone\Bazar\Models\Cart;
8
use Illuminate\Auth\Access\AuthorizationException;
9
use Illuminate\Http\Request;
10

11
class QueryStringDriver extends Driver
12
{
13
    /**
14
     * Resolve the cart for the current request.
15
     */
NEW
16
    public function resolve(Request $request): Cart
×
17
    {
NEW
18
        return Cart::proxy()
×
NEW
19
            ->where('bazar_carts.uuid', $request->query($this->config['key'] ?? 'cart'))
×
NEW
20
            ->firstOrFail();
×
21
    }
22

23
    /**
24
     * The callback after the cart instance is resolved.
25
     */
NEW
26
    protected function resolved(Request $request, Cart $cart): void
×
27
    {
NEW
28
        if (! is_null($cart->user_id) && $cart->user_id !== $request->user()?->getKey()) {
×
NEW
29
            throw new AuthorizationException(__('You are not authorized to access this cart.'));
×
30
        }
31

NEW
32
        parent::resolved($request, $cart);
×
33
    }
34
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc