snipe-it/app/Models/ConsumableAssignment.php
Laravel Shift 802dc9240d Shift bindings
PHP 5.5.9+ adds the new static `class` property which provides the fully qualified class name. This is preferred over using class name strings as these references are checked by the parser.
2021-06-10 20:16:56 +00:00

29 lines
559 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class ConsumableAssignment extends Model
{
use CompanyableTrait;
protected $dates = ['deleted_at'];
protected $table = 'consumables_users';
public function consumable()
{
return $this->belongsTo(\App\Models\Consumable::class);
}
public function user()
{
return $this->belongsTo(\App\Models\User::class, 'assigned_to');
}
public function admin()
{
return $this->belongsTo(\App\Models\User::class, 'user_id');
}
}