| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?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 string $fantasy_name
- * @property string $social_reason
- * @property string $cnpj
- * @property string|null $state_registration
- * @property string $name_responsible
- * @property string $street
- * @property string|null $address_number
- * @property string $postal_code
- * @property string $neighborhood
- * @property string|null $complement
- * @property int $city_id
- * @property int $state_id
- * @property string $email
- * @property string|null $secondary_email
- * @property string $phone_number
- * @property string|null $cell_number
- * @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\City $city
- * @property-read \App\Models\State $state
- */
- class Unit extends Model
- {
- use HasFactory, SoftDeletes;
- protected $table = 'units';
- protected $guarded = ['id'];
- protected $casts = [
- 'created_at' => 'datetime',
- 'updated_at' => 'datetime',
- 'deleted_at' => 'datetime',
- ];
- public function city(): BelongsTo
- {
- return $this->belongsTo(City::class, 'city_id');
- }
- public function state(): BelongsTo
- {
- return $this->belongsTo(State::class, 'state_id');
- }
- }
|