mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-14 10:34:31 +00:00
40 lines
613 B
PHP
40 lines
613 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Circle extends Model
|
|
{
|
|
protected $fillable = [
|
|
'profile_id',
|
|
'name',
|
|
'description',
|
|
'bcc',
|
|
'scope',
|
|
'active'
|
|
];
|
|
|
|
public function members()
|
|
{
|
|
return $this->hasManyThrough(
|
|
Profile::class,
|
|
CircleProfile::class,
|
|
'circle_id',
|
|
'id',
|
|
'id',
|
|
'profile_id'
|
|
);
|
|
}
|
|
|
|
public function owner()
|
|
{
|
|
return $this->belongsTo(Profile::class, 'profile_id');
|
|
}
|
|
|
|
public function url()
|
|
{
|
|
return url("/i/circle/show/{$this->id}");
|
|
}
|
|
}
|