• File: Product.php
  • Full Path: /home/masbinta/public_html/core/app/Models/Product.php
  • File size: 466 bytes
  • MIME-type: text/x-php
  • Charset: utf-8
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Product extends Model
{

	protected $guarded = [];
	
    public function category()
    {
		
    	return $this->belongsTo('App\Models\ProductCategory','category_id')->withDefault(function ($data) {
			foreach($data->getFillable() as $dt){
				$data[$dt] = __('Deleted');
			}
		});
	}
	
	public function product_images() {
        return $this->hasMany('App\Models\ProductImage');
    }
}