22 lines
453 B
PHP
22 lines
453 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Article extends Model
|
|
{
|
|
// * RELATIONSHIPS
|
|
|
|
/**
|
|
* BelongsToMany mediaList relation
|
|
*
|
|
* The mediaList that belong to the article.
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
|
*/
|
|
public function mediaList()
|
|
{
|
|
return $this->belongsToMany(Media::class, 'media_article', 'media_id', 'article_id');
|
|
}
|
|
}
|