| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace App\Models;
- use App\Models\Scopes\YearScope;
- use Illuminate\Database\Eloquent\Attributes\ScopedBy;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\Relations\BelongsTo;
- #[ScopedBy([YearScope::class])]
- class MafView extends Model
- {
- const DEFAULT_SORT_BY = 'created_at';
- protected $fillable = [
- 'year',
- 'product_id',
- 'order_id',
- 'maf_order_id',
- 'status', // needs - нуждается в данном товаре, related - привязана к MafOrder
- 'rfid',
- 'factory_number',
- 'manufacture_date',
- 'statement_number',
- 'statement_date',
- 'upd_number',
- 'comment',
- 'passport_id',
- 'district_name',
- 'area_name',
- 'user_name',
- 'object_address',
- 'order_number',
- 'article',
- 'nomenclature_number',
- 'name_tz',
- 'type_tz',
- 'type',
- 'manufacturer_name',
- ];
- public $table = 'mafs_view';
- /**
- * @return BelongsTo
- */
- public function product(): BelongsTo
- {
- return $this->belongsTo(Product::class, 'product_id', 'id')->withoutGlobalScopes();
- }
- }
|