2016-03-25 01:18:05 -07:00
|
|
|
<?php
|
2021-06-10 13:15:52 -07:00
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
class ConsumableAssignment extends Model
|
|
|
|
{
|
|
|
|
use CompanyableTrait;
|
|
|
|
|
|
|
|
protected $table = 'consumables_users';
|
|
|
|
|
|
|
|
public function consumable()
|
|
|
|
{
|
2021-06-10 13:16:56 -07:00
|
|
|
return $this->belongsTo(\App\Models\Consumable::class);
|
2016-03-25 01:18:05 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public function user()
|
|
|
|
{
|
2021-06-10 13:16:56 -07:00
|
|
|
return $this->belongsTo(\App\Models\User::class, 'assigned_to');
|
2016-03-25 01:18:05 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public function admin()
|
|
|
|
{
|
2021-06-10 13:16:56 -07:00
|
|
|
return $this->belongsTo(\App\Models\User::class, 'user_id');
|
2016-03-25 01:18:05 -07:00
|
|
|
}
|
|
|
|
}
|