mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-27 13:41:05 -08:00
Added acceptance model
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
a25263f868
commit
2b2853a183
|
@ -481,8 +481,6 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
|
||||||
/**
|
/**
|
||||||
* Establishes the user -> uploads relationship
|
* Establishes the user -> uploads relationship
|
||||||
*
|
*
|
||||||
* @todo I don't think we use this?
|
|
||||||
*
|
|
||||||
* @author A. Gianotto <snipe@snipe.net>
|
* @author A. Gianotto <snipe@snipe.net>
|
||||||
* @since [v3.0]
|
* @since [v3.0]
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\Relation
|
* @return \Illuminate\Database\Eloquent\Relations\Relation
|
||||||
|
@ -496,6 +494,21 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
|
||||||
->orderBy('created_at', 'desc');
|
->orderBy('created_at', 'desc');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Establishes the user -> acceptances relationship
|
||||||
|
*
|
||||||
|
* @author A. Gianotto <snipe@snipe.net>
|
||||||
|
* @since [v3.0]
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\Relation
|
||||||
|
*/
|
||||||
|
public function acceptances()
|
||||||
|
{
|
||||||
|
return $this->hasMany(\App\Models\Actionlog::class, 'target_id')
|
||||||
|
->where('target_type', self::class)
|
||||||
|
->where('action_type', '=', 'accepted')
|
||||||
|
->orderBy('created_at', 'desc');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Establishes the user -> requested assets relationship
|
* Establishes the user -> requested assets relationship
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue