Skip to content

Commit

Permalink
Merge pull request #93 from bildvitta/feature/insert-has-table-period
Browse files Browse the repository at this point in the history
boolean price table
  • Loading branch information
noemimpimentel authored Sep 10, 2024
2 parents ab7856b + b4d8d04 commit 22030fd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Models/RealEstateDevelopment/Unit.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,13 @@ public function fixedPrice(): Attribute
return '0.00';
});
}

public function hasPriceTablePeriod(): Attribute
{
return Attribute::get(function () {
$period = date('Y-m-01');

return $this->prices()->where('period', $period)->exists();
});
}
}

0 comments on commit 22030fd

Please sign in to comment.