Load admin and model on assets

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-08-10 17:00:20 +01:00
parent 1c229a8e08
commit 71729f0b16

View file

@ -31,6 +31,7 @@ class Asset extends Depreciable
{
protected $presenter = AssetPresenter::class;
protected $with = ['model', 'admin'];
use CompanyableTrait;
use HasFactory, Loggable, Requestable, Presentable, SoftDeletes, ValidatingTrait, UniqueUndeletedTrait;
@ -716,7 +717,7 @@ class Asset extends Depreciable
* @since [v1.0]
* @return \Illuminate\Database\Eloquent\Relations\Relation
*/
public function adminuser()
public function admin()
{
return $this->belongsTo(\App\Models\User::class, 'user_id');
}