PaymentSchedule.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Factories\HasFactory;
  4. use Illuminate\Database\Eloquent\Model;
  5. use Illuminate\Database\Eloquent\Relations\BelongsTo;
  6. /**
  7. * @property-read \App\Models\Payment|null $payment
  8. * @property-read \App\Models\Schedule|null $schedule
  9. * @method static \Illuminate\Database\Eloquent\Builder<static>|PaymentSchedule newModelQuery()
  10. * @method static \Illuminate\Database\Eloquent\Builder<static>|PaymentSchedule newQuery()
  11. * @method static \Illuminate\Database\Eloquent\Builder<static>|PaymentSchedule query()
  12. * @mixin \Eloquent
  13. */
  14. class PaymentSchedule extends Model
  15. {
  16. use HasFactory;
  17. protected $table = 'payment_schedules';
  18. protected $fillable = [
  19. 'payment_id',
  20. 'schedule_id',
  21. ];
  22. protected $casts = [
  23. 'created_at' => 'datetime',
  24. 'updated_at' => 'datetime',
  25. ];
  26. public function payment(): BelongsTo
  27. {
  28. return $this->belongsTo(Payment::class);
  29. }
  30. public function schedule(): BelongsTo
  31. {
  32. return $this->belongsTo(Schedule::class);
  33. }
  34. }