unioil-loyalty-app/app/ProductCategory.php

45 lines
714 B
PHP

<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class ProductCategory extends Model
{
/**
* Table name of model
*
* @var string
*/
protected $table = 'product_category';
/**
* Primary key field name of table
*
* @var string
*/
protected $primaryKey = 'pc_id';
/**
* Additional fields from other connected tables
*
* @var array
*/
protected $appends = [];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = ['pc_id'];
public function productDetails()
{
return $this->hasMany('App\ProductDetails','pc_id','pc_id');
}
}