Franchisee.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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\BelongsToMany;
  6. use Illuminate\Database\Eloquent\SoftDeletes;
  7. /**
  8. * @property int $id
  9. * @property string $name
  10. * @property string|null $cpf
  11. * @property string|null $rg
  12. * @property string|null $cnpj
  13. * @property string|null $phone
  14. * @property string|null $cellphone_number
  15. * @property string $street
  16. * @property string|null $address_number
  17. * @property string $neighborhood
  18. * @property string $postal_code
  19. * @property int $city_id
  20. * @property int $state_id
  21. * @property string $birth_date
  22. * @property \Carbon\Carbon $created_at
  23. * @property \Carbon\Carbon $updated_at
  24. * @property \Carbon\Carbon|null $deleted_at
  25. */
  26. class Franchisee extends Model
  27. {
  28. use HasFactory, SoftDeletes;
  29. protected $table = 'franchisees';
  30. protected $guarded = ['id'];
  31. protected $casts = [
  32. 'created_at' => 'datetime',
  33. 'updated_at' => 'datetime',
  34. 'deleted_at' => 'datetime',
  35. ];
  36. public function units(): BelongsToMany
  37. {
  38. return $this->belongsToMany(Unit::class, 'franchisee_units');
  39. }
  40. }