| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Factories\HasFactory;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\Relations\BelongsTo;
- use Illuminate\Database\Eloquent\SoftDeletes;
- /**
- * @property int $id
- * @property int $unit_id
- * @property string $name
- * @property string|null $social_name
- * @property string|null $role
- * @property string $cpf
- * @property string|null $rg
- * @property \Carbon\Carbon|null $birth_date
- * @property float|null $participation
- * @property string|null $email
- * @property string|null $secondary_email
- * @property string|null $phone_number
- * @property string|null $cell_number
- * @property string|null $postal_code
- * @property string|null $street
- * @property string|null $address_number
- * @property string|null $neighborhood
- * @property string|null $complement
- * @property int|null $city_id
- * @property int|null $state_id
- * @property string|null $avatar_url
- * @property \Carbon\Carbon $created_at
- * @property \Carbon\Carbon $updated_at
- * @property \Carbon\Carbon|null $deleted_at
- * @property-read \App\Models\Unit $unit
- * @property-read \App\Models\City|null $city
- * @property-read \App\Models\State|null $state
- */
- class UnitPartner extends Model
- {
- use HasFactory, SoftDeletes;
- protected $table = 'unit_partners';
- protected $guarded = ['id'];
- protected $casts = [
- 'birth_date' => 'date',
- 'participation' => 'decimal:2',
- 'created_at' => 'datetime',
- 'updated_at' => 'datetime',
- 'deleted_at' => 'datetime',
- ];
- public function unit(): BelongsTo
- {
- return $this->belongsTo(Unit::class, 'unit_id');
- }
- public function city(): BelongsTo
- {
- return $this->belongsTo(City::class, 'city_id');
- }
- public function state(): BelongsTo
- {
- return $this->belongsTo(State::class, 'state_id');
- }
- }
|