<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;

class Product extends Model
{
	use HasDateTimeFormatter;
    use SoftDeletes;

    protected $table = 'product';

    protected $fillable = [
        'type',
        'user_id',
        'name',
        'content',
        'image',
        'status'
    ];

    public function type(){
        return $this->hasOne(ProductType::class,'id','type');
    }

    public function user(){
        return $this->hasOne(User::class,'id','user_id');
    }
}
