Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
19 lines (14 sloc) 323 Bytes
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Article extends Model
{
public function authors()
{
return $this->belongsToMany(Author::class);
}
public function authorsToDisplay()
{
return $this->belongsToMany(Author::class)->wherePivot('display', true);
}
}
You can’t perform that action at this time.