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

conedevelopment / root / 18281319793

06 Oct 2025 12:46PM UTC coverage: 76.331% (-0.02%) from 76.348%
18281319793

push

github

iamgergo
fix n+1

4 of 6 new or added lines in 2 files covered. (66.67%)

3354 of 4394 relevant lines covered (76.33%)

34.53 hits per line

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

50.0
/src/Traits/HasMetaData.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Cone\Root\Traits;
6

7
use Cone\Root\Models\Meta;
8
use Illuminate\Database\Eloquent\Relations\MorphMany;
9

10
trait HasMetaData
11
{
12
    /**
13
     * Get the meta data for the model.
14
     */
15
    public function metaData(): MorphMany
4✔
16
    {
17
        return $this->morphMany(Meta::getProxiedClass(), 'metable');
4✔
18
    }
19

20
    /**
21
     * Get the meta value of the given key.
22
     */
23
    public function metaValue(string $key, mixed $default = null): mixed
×
24
    {
NEW
25
        return $this->metaData->sortByDesc('created_at')->firstWhere('key', $key)?->value ?: $default;
×
26
    }
27
}
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