ldc-legaulois/app/Models/Customers.php

29 lines
726 B
PHP

<?php
namespace App\Models;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class Customers extends Authenticatable
{
use Notifiable;
protected $guard = 'customer';
public function recipes() {
return $this->belongsToMany('App\Models\Recipes', 'customer_recipe', 'customer_id', 'recipe_id');
}
public function products() {
return $this->belongsToMany('App\Models\Products', 'cart', 'customer_id', 'product_id');
}
public function forums() {
return $this->hasMany('App\Models\Forum', 'customer_id');
}
public function answers() {
return $this->hasMany('App\Models\ForumAnswers', 'customer_id');
}
}