| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- declare(strict_types=1);
- namespace App\Models;
- use Database\Factories\ProductionOrderInstallationFactory;
- use Illuminate\Database\Eloquent\Factories\HasFactory;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\Relations\BelongsTo;
- use Illuminate\Database\Eloquent\Relations\HasMany;
- use Illuminate\Database\Eloquent\SoftDeletes;
- class ProductionOrderInstallation extends Model
- {
- /** @use HasFactory<ProductionOrderInstallationFactory> */
- use HasFactory;
- use SoftDeletes;
- protected $fillable = [
- 'production_order_id',
- 'installation_date',
- 'installation_days',
- 'brigadier_id',
- 'note',
- 'created_by',
- 'updated_by',
- ];
- protected function casts(): array
- {
- return [
- 'production_order_id' => 'integer',
- 'installation_date' => 'immutable_date',
- 'installation_days' => 'integer',
- 'brigadier_id' => 'integer',
- 'created_by' => 'integer',
- 'updated_by' => 'integer',
- ];
- }
- public function productionOrder(): BelongsTo
- {
- return $this->belongsTo(ProductionOrder::class);
- }
- public function brigadier(): BelongsTo
- {
- return $this->belongsTo(User::class, 'brigadier_id');
- }
- public function schedules(): HasMany
- {
- return $this->hasMany(Schedule::class);
- }
- }
|