You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Contact.php 984B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace App\Models\Common;
  3. use App\Concerns\Blamable;
  4. use App\Concerns\CompanyOwned;
  5. use App\Enums\Common\ContactType;
  6. use Database\Factories\Common\ContactFactory;
  7. use Illuminate\Database\Eloquent\Factories\Factory;
  8. use Illuminate\Database\Eloquent\Factories\HasFactory;
  9. use Illuminate\Database\Eloquent\Model;
  10. use Illuminate\Database\Eloquent\Relations\MorphTo;
  11. class Contact extends Model
  12. {
  13. use Blamable;
  14. use CompanyOwned;
  15. use HasFactory;
  16. protected $table = 'contacts';
  17. protected $fillable = [
  18. 'company_id',
  19. 'type',
  20. 'first_name',
  21. 'last_name',
  22. 'email',
  23. 'phones',
  24. 'is_primary',
  25. 'created_by',
  26. 'updated_by',
  27. ];
  28. protected $casts = [
  29. 'type' => ContactType::class,
  30. ];
  31. public function contactable(): MorphTo
  32. {
  33. return $this->morphTo();
  34. }
  35. protected static function newFactory(): Factory
  36. {
  37. return ContactFactory::new();
  38. }
  39. }