invoiceninja/app/Models/Product.php

36 lines
586 B
PHP
Raw Normal View History

<?php
namespace App\Models;
2019-04-03 11:09:22 +11:00
use App\Models\Filterable;
use App\Utils\Traits\MakesHash;
use Illuminate\Database\Eloquent\Model;
2019-04-03 11:09:22 +11:00
use Illuminate\Database\Eloquent\SoftDeletes;
class Product extends BaseModel
{
use MakesHash;
2019-04-03 11:09:22 +11:00
use SoftDeletes;
use Filterable;
protected $guarded = [
2019-04-03 13:34:28 +11:00
'id',
'updated_at',
'created_at',
'deleted_at',
'q',
];
2019-04-03 11:09:22 +11:00
public function company()
{
2019-04-03 11:09:22 +11:00
return $this->belongsTo(Company::class);
}
2019-04-03 11:09:22 +11:00
public function user()
{
2019-04-03 11:09:22 +11:00
return $this->belongsTo(User::class);
}
2019-04-03 11:09:22 +11:00
}