12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
-
- namespace App\Models\Accounting;
-
- use App\Concerns\Blamable;
- use App\Concerns\CompanyOwned;
- use Illuminate\Database\Eloquent\Factories\HasFactory;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\Relations\BelongsTo;
- use Illuminate\Database\Eloquent\Relations\HasMany;
-
- class BudgetItem extends Model
- {
- use Blamable;
- use CompanyOwned;
- use HasFactory;
-
- protected $fillable = [
- 'company_id',
- 'budget_id',
- 'account_id',
- 'created_by',
- 'updated_by',
- ];
-
- public function budget(): BelongsTo
- {
- return $this->belongsTo(Budget::class);
- }
-
- public function account(): BelongsTo
- {
- return $this->belongsTo(Account::class);
- }
-
- public function allocations(): HasMany
- {
- return $this->hasMany(BudgetAllocation::class);
- }
- }
|