You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BudgetAllocation.php 775B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace App\Models\Accounting;
  3. use App\Casts\DocumentMoneyCast;
  4. use App\Concerns\CompanyOwned;
  5. use Illuminate\Database\Eloquent\Factories\HasFactory;
  6. use Illuminate\Database\Eloquent\Model;
  7. use Illuminate\Database\Eloquent\Relations\BelongsTo;
  8. class BudgetAllocation extends Model
  9. {
  10. use CompanyOwned;
  11. use HasFactory;
  12. protected $fillable = [
  13. 'company_id',
  14. 'budget_item_id',
  15. 'period',
  16. 'interval_type',
  17. 'start_date',
  18. 'end_date',
  19. 'amount',
  20. ];
  21. protected $casts = [
  22. 'start_date' => 'date',
  23. 'end_date' => 'date',
  24. 'amount' => DocumentMoneyCast::class,
  25. ];
  26. public function budgetItem(): BelongsTo
  27. {
  28. return $this->belongsTo(BudgetItem::class);
  29. }
  30. }