• 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

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

3
namespace Cone\Root\Traits;
4

5
use Cone\Root\Models\Meta;
6
use Illuminate\Database\Eloquent\Relations\MorphMany;
7

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

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

© 2025 Coveralls, Inc