testlara/app/Models/DocumentProduct.php

25 lines
629 B
PHP
Raw Normal View History

2023-10-27 19:59:05 +03:00
<?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\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\SoftDeletes;
class DocumentProduct extends Model
{
protected $table = 'document_product';
use HasFactory;
protected $fillable = ['product_id', 'document_id', 'quantity', 'past_quantity'];
public function product(): BelongsTo
{
return $this->belongsTo(Product::class);
}
}