| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- namespace App\Models;
- use App\Models\Dictionary\Area;
- use App\Models\Dictionary\District;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\Relations\BelongsTo;
- class Schedule extends Model
- {
- protected $fillable = [
- 'installation_date',
- 'manual',
- 'order_id',
- 'district_id',
- 'area_id',
- 'object_address',
- 'object_type_id',
- 'mafs',
- 'mafs_count',
- 'brigadier_id',
- 'comment',
- ];
- public function district(): BelongsTo
- {
- return $this->belongsTo(District::class);
- }
- public function area(): BelongsTo
- {
- return $this->belongsTo(Area::class);
- }
- public function objectType(): BelongsTo
- {
- return $this->belongsTo(ObjectType::class);
- }
- public function brigadier(): BelongsTo
- {
- return $this->belongsTo(User::class, 'brigadier_id', 'id');
- }
- }
|