31 lines
583 B
PHP
31 lines
583 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Dcat\Admin\Traits\HasDateTimeFormatter;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class DealerUserProduct extends Model
|
|
{
|
|
use HasFactory;
|
|
use HasDateTimeFormatter;
|
|
|
|
protected $attributes = [
|
|
'stock' => 0,
|
|
'deposit_stock' => 0,
|
|
];
|
|
|
|
protected $fillable = [
|
|
'user_id',
|
|
'product_id',
|
|
'stock',
|
|
'deposit_stock',
|
|
];
|
|
|
|
public function product()
|
|
{
|
|
return $this->belongsTo(DealerProduct::class, 'product_id');
|
|
}
|
|
}
|