vendor machine seeder

This commit is contained in:
glovetleong
2021-06-26 16:40:24 +08:00
parent c07faf92a8
commit 0be9350b30
18 changed files with 473 additions and 13 deletions
+13 -2
View File
@@ -2,10 +2,21 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class ContractTemplate extends Model
{
use HasFactory;
protected $table = 'contract_templates';
protected $appends = ['contract_template_obligation_list'];
public function contract_template_obligation()
{
return $this->hasMany('App\Models\ContractTemplateObligation', 'contract_template_id');
}
public function getContractTemplateObligationListAttribute()
{
return $this->contract_template_obligation()->get();
}
}