mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-13 17:14:10 -08:00
802dc9240d
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.
29 lines
559 B
PHP
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');
|
|
}
|
|
}
|