Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
UsesUserModel
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 user
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Engelsystem\Models\User;
6
7use Illuminate\Database\Eloquent\Builder;
8use Illuminate\Database\Eloquent\Relations\BelongsTo;
9
10/**
11 * @property int       $user_id
12 *
13 * @property-read User $user
14 *
15 * @method static Builder|static[] whereUserId($value)
16 */
17trait UsesUserModel
18{
19    // protected $fillable = ['user_id'];
20    // protected $casts = ['user_id' => 'integer];
21
22    public function user(): BelongsTo
23    {
24        return $this->belongsTo(User::class);
25    }
26}