Load admin and model on assets
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
1c229a8e08
commit
71729f0b16
1 changed files with 2 additions and 1 deletions
|
@ -31,6 +31,7 @@ class Asset extends Depreciable
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $presenter = AssetPresenter::class;
|
protected $presenter = AssetPresenter::class;
|
||||||
|
protected $with = ['model', 'admin'];
|
||||||
|
|
||||||
use CompanyableTrait;
|
use CompanyableTrait;
|
||||||
use HasFactory, Loggable, Requestable, Presentable, SoftDeletes, ValidatingTrait, UniqueUndeletedTrait;
|
use HasFactory, Loggable, Requestable, Presentable, SoftDeletes, ValidatingTrait, UniqueUndeletedTrait;
|
||||||
|
@ -716,7 +717,7 @@ class Asset extends Depreciable
|
||||||
* @since [v1.0]
|
* @since [v1.0]
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\Relation
|
* @return \Illuminate\Database\Eloquent\Relations\Relation
|
||||||
*/
|
*/
|
||||||
public function adminuser()
|
public function admin()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(\App\Models\User::class, 'user_id');
|
return $this->belongsTo(\App\Models\User::class, 'user_id');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue