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

conedevelopment / root / 15084089635

17 May 2025 10:00AM UTC coverage: 77.93% (+0.04%) from 77.891%
15084089635

push

github

web-flow
Modernize back-end.yml (#240)

3291 of 4223 relevant lines covered (77.93%)

36.04 hits per line

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

52.94
/src/Filters/TrashStatus.php
1
<?php
2

3
namespace Cone\Root\Filters;
4

5
use Illuminate\Database\Eloquent\Builder;
6
use Illuminate\Database\Eloquent\SoftDeletes;
7
use Illuminate\Http\Request;
8

9
class TrashStatus extends Select
10
{
11
    /**
12
     * Apply the filter on the query.
13
     */
14
    public function apply(Request $request, Builder $query, mixed $value): Builder
×
15
    {
16
        if (! in_array(SoftDeletes::class, class_uses_recursive($query->getModel()))) {
×
17
            return $query;
×
18
        }
19

20
        return match ($value) {
×
21
            'all' => $query->withTrashed(),
×
22
            'trashed' => $query->onlyTrashed(),
×
23
            default => $query,
×
24
        };
×
25
    }
26

27
    /**
28
     * Determine if the filter is active.
29
     */
30
    public function isActive(Request $request): bool
3✔
31
    {
32
        return parent::isActive($request)
3✔
33
            && $this->getValue($request) !== 'available';
3✔
34
    }
35

36
    /**
37
     * Get the filter options.
38
     */
39
    public function options(Request $request): array
1✔
40
    {
41
        return [
1✔
42
            'available' => __('Available'),
1✔
43
            'trashed' => __('Trashed'),
1✔
44
            'all' => __('All'),
1✔
45
        ];
1✔
46
    }
47
}
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