ldc-dam/app/Models/Article.php

23 lines
453 B
PHP
Raw Normal View History

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Article extends Model
{
// * RELATIONSHIPS
2022-04-19 16:07:27 +02:00
/**
* BelongsToMany mediaList relation
*
* The mediaList that belong to the article.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
2022-04-19 16:07:27 +02:00
*/
public function mediaList()
2022-04-19 16:07:27 +02:00
{
2022-07-28 12:32:37 +02:00
return $this->belongsToMany(Media::class, 'media_article', 'media_id', 'article_id');
2022-04-19 16:07:27 +02:00
}
}