TreasuryLaunch.php 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Factories\HasFactory;
  4. use Illuminate\Database\Eloquent\Model;
  5. /**
  6. * @property int $id
  7. * @property int|null $unit_id
  8. * @property int|null $financial_plan_account_id
  9. * @property int $user_id
  10. * @property string $transaction_type
  11. * @property int|null $from_account_id
  12. * @property int|null $to_account_id
  13. * @property string $description
  14. * @property numeric $amount
  15. * @property \Illuminate\Support\Carbon $launch_date
  16. * @property bool $is_reconciled
  17. * @property string $origin
  18. * @property string|null $reference_table
  19. * @property int|null $reference_id
  20. * @property \Illuminate\Support\Carbon|null $created_at
  21. * @property \Illuminate\Support\Carbon|null $updated_at
  22. * @property string|null $deleted_at
  23. * @property-read \App\Models\FinancialPlanAccount|null $financialPlanAccount
  24. * @method static \Illuminate\Database\Eloquent\Builder<static>|TreasuryLaunch newModelQuery()
  25. * @method static \Illuminate\Database\Eloquent\Builder<static>|TreasuryLaunch newQuery()
  26. * @method static \Illuminate\Database\Eloquent\Builder<static>|TreasuryLaunch query()
  27. * @method static \Illuminate\Database\Eloquent\Builder<static>|TreasuryLaunch whereAmount($value)
  28. * @method static \Illuminate\Database\Eloquent\Builder<static>|TreasuryLaunch whereCreatedAt($value)
  29. * @method static \Illuminate\Database\Eloquent\Builder<static>|TreasuryLaunch whereDeletedAt($value)
  30. * @method static \Illuminate\Database\Eloquent\Builder<static>|TreasuryLaunch whereDescription($value)
  31. * @method static \Illuminate\Database\Eloquent\Builder<static>|TreasuryLaunch whereFinancialPlanAccountId($value)
  32. * @method static \Illuminate\Database\Eloquent\Builder<static>|TreasuryLaunch whereFromAccountId($value)
  33. * @method static \Illuminate\Database\Eloquent\Builder<static>|TreasuryLaunch whereId($value)
  34. * @method static \Illuminate\Database\Eloquent\Builder<static>|TreasuryLaunch whereIsReconciled($value)
  35. * @method static \Illuminate\Database\Eloquent\Builder<static>|TreasuryLaunch whereLaunchDate($value)
  36. * @method static \Illuminate\Database\Eloquent\Builder<static>|TreasuryLaunch whereOrigin($value)
  37. * @method static \Illuminate\Database\Eloquent\Builder<static>|TreasuryLaunch whereReferenceId($value)
  38. * @method static \Illuminate\Database\Eloquent\Builder<static>|TreasuryLaunch whereReferenceTable($value)
  39. * @method static \Illuminate\Database\Eloquent\Builder<static>|TreasuryLaunch whereToAccountId($value)
  40. * @method static \Illuminate\Database\Eloquent\Builder<static>|TreasuryLaunch whereTransactionType($value)
  41. * @method static \Illuminate\Database\Eloquent\Builder<static>|TreasuryLaunch whereUnitId($value)
  42. * @method static \Illuminate\Database\Eloquent\Builder<static>|TreasuryLaunch whereUpdatedAt($value)
  43. * @method static \Illuminate\Database\Eloquent\Builder<static>|TreasuryLaunch whereUserId($value)
  44. * @mixin \Eloquent
  45. */
  46. class TreasuryLaunch extends Model
  47. {
  48. use HasFactory;
  49. protected $table = 'treasury_launches';
  50. protected $guarded = [
  51. 'id', // Add more fields that shouldn't be edited here
  52. ];
  53. protected $casts = [
  54. 'created_at' => 'datetime',
  55. 'updated_at' => 'datetime',
  56. 'launch_date' => 'date:Y-m-d',
  57. 'amount' => 'decimal:2',
  58. 'is_reconciled' => 'boolean',
  59. ];
  60. // Relationships
  61. public function financialPlanAccount(): \Illuminate\Database\Eloquent\Relations\BelongsTo
  62. {
  63. return $this->belongsTo(FinancialPlanAccount::class, 'financial_plan_account_id');
  64. }
  65. // Business Logic Methods
  66. // Custom Finders
  67. // Query Scopes
  68. }