mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Make sure the user exists
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
abd79219dd
commit
759bb822ff
|
@ -3,13 +3,19 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Watson\Validating\ValidatingTrait;
|
||||
|
||||
class ConsumableAssignment extends Model
|
||||
{
|
||||
use CompanyableTrait;
|
||||
use ValidatingTrait;
|
||||
|
||||
protected $table = 'consumables_users';
|
||||
|
||||
public $rules = [
|
||||
'assigned_to' => 'exists:users,id',
|
||||
];
|
||||
|
||||
public function consumable()
|
||||
{
|
||||
return $this->belongsTo(\App\Models\Consumable::class);
|
||||
|
|
Loading…
Reference in a new issue