22 lines
419 B
PHP
22 lines
419 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Recipes extends Model
|
|
{
|
|
// TODO : Ajouter la relation avec News
|
|
/**
|
|
* Relation Many to Many avec news
|
|
*/
|
|
/*public function news()
|
|
{
|
|
|
|
return $this->morphToMany('App\Models\News', 'taggable');
|
|
}*/
|
|
|
|
public function products() {
|
|
return $this->hasMany('App\Models\Products', 'recipe_id');
|
|
}
|
|
}
|