OwnerFeeOperation.php 893 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace App;
  3. use Illuminate\Database\Eloquent\Model;
  4. use App\Traits\ModelLogChanging;
  5. use Illuminate\Database\Eloquent\Relations\BelongsTo;
  6. use Illuminate\Database\Eloquent\Relations\HasMany;
  7. class OwnerFeeOperation extends Model
  8. {
  9. use ModelLogChanging;
  10. public $timestamps = false;
  11. protected $fillable = [
  12. "worked_at",
  13. "model_id",
  14. "source_number",
  15. "doc_number",
  16. "commodity_id",
  17. "total_fee",
  18. "tax_rate",
  19. "fee_description",
  20. "owner_id",
  21. ];
  22. public function details(): HasMany
  23. {
  24. return $this->hasMany(OwnerFeeOperationDetail::class);
  25. }
  26. public function model(): BelongsTo
  27. {
  28. return $this->belongsTo(OwnerPriceOperation::class, 'model_id', 'id');
  29. }
  30. public function commodity(): BelongsTo
  31. {
  32. return $this->belongsTo(Commodity::class);
  33. }
  34. }