mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-12 16:44:08 -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;
|
namespace App\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Watson\Validating\ValidatingTrait;
|
||||||
|
|
||||||
class ConsumableAssignment extends Model
|
class ConsumableAssignment extends Model
|
||||||
{
|
{
|
||||||
use CompanyableTrait;
|
use CompanyableTrait;
|
||||||
|
use ValidatingTrait;
|
||||||
|
|
||||||
protected $table = 'consumables_users';
|
protected $table = 'consumables_users';
|
||||||
|
|
||||||
|
public $rules = [
|
||||||
|
'assigned_to' => 'exists:users,id',
|
||||||
|
];
|
||||||
|
|
||||||
public function consumable()
|
public function consumable()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(\App\Models\Consumable::class);
|
return $this->belongsTo(\App\Models\Consumable::class);
|
||||||
|
|
Loading…
Reference in a new issue