mirror of https://github.com/pixelfed/pixelfed
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.3 KiB
PHTML
59 lines
1.3 KiB
PHTML
|
8 years ago
|
<?php
|
||
|
|
|
||
|
4 weeks ago
|
namespace App\Models;
|
||
|
8 years ago
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
4 weeks ago
|
use Illuminate\Support\Carbon;
|
||
|
8 years ago
|
|
||
|
10 months ago
|
/**
|
||
|
|
* @property int $id
|
||
|
|
* @property int $follower_id
|
||
|
|
* @property int $following_id
|
||
|
|
* @property array|null $activity
|
||
|
4 weeks ago
|
* @property Carbon|null $handled_at
|
||
|
|
* @property Carbon|null $created_at
|
||
|
|
* @property Carbon|null $updated_at
|
||
|
|
* @property-read Profile $target
|
||
|
|
* @property-read Profile $actor
|
||
|
|
* @property-read Profile $follower
|
||
|
|
* @property-read Profile $following
|
||
|
10 months ago
|
*/
|
||
|
8 years ago
|
class FollowRequest extends Model
|
||
|
|
{
|
||
|
4 weeks ago
|
protected $guarded = [];
|
||
|
4 years ago
|
|
||
|
7 months ago
|
protected function casts(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'activity' => 'array',
|
||
|
|
];
|
||
|
|
}
|
||
|
4 years ago
|
|
||
|
|
public function actor()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Profile::class, 'follower_id', 'id');
|
||
|
|
}
|
||
|
9 months ago
|
|
||
|
8 years ago
|
public function follower()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Profile::class, 'follower_id', 'id');
|
||
|
|
}
|
||
|
|
|
||
|
|
public function following()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Profile::class, 'following_id', 'id');
|
||
|
|
}
|
||
|
8 years ago
|
|
||
|
|
public function target()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Profile::class, 'following_id', 'id');
|
||
|
|
}
|
||
|
4 years ago
|
|
||
|
4 years ago
|
public function permalink($append = null, $namespace = '#accepts')
|
||
|
4 years ago
|
{
|
||
|
4 years ago
|
$path = $this->target->permalink("{$namespace}/follows/{$this->id}{$append}");
|
||
|
9 months ago
|
|
||
|
4 years ago
|
return url($path);
|
||
|
|
}
|
||
|
8 years ago
|
}
|