HasUserModel: Moved user method to trait
parent
4c81fee548
commit
a514ba3adc
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Engelsystem\Models\User;
|
||||
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* @property integer $user_id
|
||||
*
|
||||
* @property-read \Illuminate\Database\Query\Builder|\Engelsystem\Models\User\User $user
|
||||
*
|
||||
* @method static \Illuminate\Database\Query\Builder|static whereUserId($value)
|
||||
*/
|
||||
trait UsesUserModel
|
||||
{
|
||||
// protected $fillable = ['user_id'];
|
||||
|
||||
/**
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Engelsystem\Test\Unit\Models\User\Stub;
|
||||
|
||||
use Engelsystem\Models\User\HasUserModel;
|
||||
|
||||
class HasUserModelImplementation extends HasUserModel
|
||||
{
|
||||
}
|
Loading…
Reference in New Issue