testlara/app/Models/Product.php

23 lines
517 B
PHP
Raw Permalink 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\BelongsToMany;
use Illuminate\Database\Eloquent\SoftDeletes;
class Product extends Model
{
protected $table = 'product';
use HasFactory; use SoftDeletes;
protected $fillable = ['name', 'article', 'price', 'quantity'];
public function documents(): BelongsToMany
{
return $this->belongsToMany(Document::class);
}
}