mirror of
https://github.com/YunoHost-Apps/pixelfed_ynh.git
synced 2024-09-03 20:06:04 +02:00
Update Place model
This commit is contained in:
parent
f3415e80ed
commit
a8b63934e4
1 changed files with 6 additions and 8 deletions
|
@ -7,15 +7,8 @@ use Pixelfed\Snowflake\HasSnowflakePrimary;
|
||||||
|
|
||||||
class Place extends Model
|
class Place extends Model
|
||||||
{
|
{
|
||||||
use HasSnowflakePrimary;
|
protected $visible = ['id', 'name', 'country', 'slug'];
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicates if the IDs are auto-incrementing.
|
|
||||||
*
|
|
||||||
* @var bool
|
|
||||||
*/
|
|
||||||
public $incrementing = false;
|
|
||||||
|
|
||||||
public function url()
|
public function url()
|
||||||
{
|
{
|
||||||
return url('/discover/places/' . $this->id . '/' . $this->slug);
|
return url('/discover/places/' . $this->id . '/' . $this->slug);
|
||||||
|
@ -30,4 +23,9 @@ class Place extends Model
|
||||||
{
|
{
|
||||||
return $this->posts()->count();
|
return $this->posts()->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function statuses()
|
||||||
|
{
|
||||||
|
return $this->hasMany(Status::class, 'id', 'place_id');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue