Supplier.php 930 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Factories\HasFactory;
  4. use Illuminate\Database\Eloquent\Model;
  5. class Supplier extends Model
  6. {
  7. use HasFactory;
  8. protected $fillable = [
  9. 'name',
  10. 'fiscal_code',
  11. 'vat',
  12. 'address',
  13. 'zip_code',
  14. 'nation_id',
  15. 'province_id',
  16. 'city_id',
  17. 'referent',
  18. 'website',
  19. 'phone',
  20. 'email',
  21. 'referent_first_name',
  22. 'referent_last_name',
  23. 'referent_email',
  24. 'referent_phone',
  25. 'referent_mobile',
  26. 'enabled',
  27. 'archived',
  28. ];
  29. public function nation()
  30. {
  31. return $this->belongsTo(\App\Models\Nation::class);
  32. }
  33. public function province()
  34. {
  35. return $this->belongsTo(\App\Models\Province::class);
  36. }
  37. public function city()
  38. {
  39. return $this->belongsTo(\App\Models\City::class);
  40. }
  41. }