Files
lpj/app/Models/PenawaranTender.php
2024-10-09 20:22:49 +07:00

27 lines
598 B
PHP

<?php
namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\HasMany; // andy add
class PenawaranTender extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*/
protected $table = 'penawaran';
protected $guarded = ['id'];
// andy add
public function penawarandetails(): HasMany
{
return $this->hasMany(PenawaranDetailTender::class, 'penawaran_id', 'id')->where('status', '=', 1);
}
// andy add
}