diff --git a/Category.php b/Category.php new file mode 100644 index 0000000..48eeee1 --- /dev/null +++ b/Category.php @@ -0,0 +1,22 @@ +belongsTo('App\Models\ReceiptItem'); + } + + public function services() + { + return $this->belongsToMany('App\Models\Service', 'categories_services', 'category_id', 'service_id')->withTimestamps();; + } + + protected $hidden = [ + 'pivot' + ]; +} diff --git a/CategoryService.php b/CategoryService.php new file mode 100644 index 0000000..9b39771 --- /dev/null +++ b/CategoryService.php @@ -0,0 +1,10 @@ +belongsTo('App\User'); + } + + public function store() + { + return $this->belongsTo('App\User'); + } + + public function receipt_items() + { + return $this->hasMany('App\Models\ReceiptItem'); + } +} diff --git a/ReceiptItem.php b/ReceiptItem.php new file mode 100644 index 0000000..d4780c6 --- /dev/null +++ b/ReceiptItem.php @@ -0,0 +1,21 @@ +belongsTo('App\Models\Receipt'); + } + + public function categories() + { + return $this->hasMany('App\Models\Category'); + } +} diff --git a/Service.php b/Service.php new file mode 100644 index 0000000..14b80fd --- /dev/null +++ b/Service.php @@ -0,0 +1,46 @@ + 'datetime', + ]; + + public function users() + { + return $this->belongsToMany('App\Models\Category', 'categories_services')->withTimestamps();; + } +}