mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-23 23:11:27 +00:00
68 lines
1,000 B
PHP
68 lines
1,000 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Instance extends Model
|
|
{
|
|
protected $fillable = ['domain', 'banned', 'auto_cw', 'unlisted', 'notes'];
|
|
|
|
public function profiles()
|
|
{
|
|
return $this->hasMany(Profile::class, 'domain', 'domain');
|
|
}
|
|
|
|
public function statuses()
|
|
{
|
|
return $this->hasManyThrough(
|
|
Status::class,
|
|
Profile::class,
|
|
'domain',
|
|
'profile_id',
|
|
'domain',
|
|
'id'
|
|
);
|
|
}
|
|
|
|
public function reported()
|
|
{
|
|
return $this->hasManyThrough(
|
|
Report::class,
|
|
Profile::class,
|
|
'domain',
|
|
'reported_profile_id',
|
|
'domain',
|
|
'id'
|
|
);
|
|
}
|
|
|
|
public function reports()
|
|
{
|
|
return $this->hasManyThrough(
|
|
Report::class,
|
|
Profile::class,
|
|
'domain',
|
|
'profile_id',
|
|
'domain',
|
|
'id'
|
|
);
|
|
}
|
|
|
|
public function media()
|
|
{
|
|
return $this->hasManyThrough(
|
|
Media::class,
|
|
Profile::class,
|
|
'domain',
|
|
'profile_id',
|
|
'domain',
|
|
'id'
|
|
);
|
|
}
|
|
|
|
public function getUrl()
|
|
{
|
|
return url("/i/admin/instances/show/{$this->id}");
|
|
}
|
|
}
|