2019-02-10 05:40:10 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
class Circle extends Model
|
|
|
|
{
|
|
|
|
protected $fillable = [
|
2019-02-16 03:56:44 +00:00
|
|
|
'profile_id',
|
2019-02-10 05:40:10 +00:00
|
|
|
'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}");
|
|
|
|
}
|
|
|
|
}
|