3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-02-05 11:15:33 +00:00
Files
snipe-it/app/Models/ConsumableAssignment.php
2025-08-28 18:23:26 +01:00

35 lines
721 B
PHP

<?php
namespace App\Models;
use App\Models\Traits\CompanyableTrait;
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' => 'required|exists:users,id',
];
public function consumable()
{
return $this->belongsTo(\App\Models\Consumable::class);
}
public function user()
{
return $this->belongsTo(\App\Models\User::class, 'assigned_to');
}
public function adminuser()
{
return $this->belongsTo(\App\Models\User::class, 'created_by');
}
}