<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Article extends Model
{
/**
* The medias that belong to the article.
*/
public function medias()
return $this->belongsToMany('App\Models\Media', 'medias_articles', 'article_id', 'media_id');
}