Paragonik/Category.php

23 lines
435 B
PHP
Raw Permalink Normal View History

2020-01-13 17:51:49 +01:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Category extends Model
{
public function receipt_items()
{
return $this->belongsTo('App\Models\ReceiptItem');
}
public function services()
{
return $this->belongsToMany('App\Models\Service', 'categories_services', 'category_id', 'service_id')->withTimestamps();;
}
protected $hidden = [
'pivot'
];
}