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.
pixelfed/app/Models/Follower.php

67 lines
2.2 KiB
PHTML

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Carbon;
/**
* @property int $id
* @property int $profile_id
* @property int $following_id
4 days ago
* @property int $local_profile
* @property int $local_following
* @property int $show_reblogs
* @property int $notify
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
4 days ago
* @property-read Profile|null $actor
* @property-read Profile|null $profile
* @property-read Profile|null $target
*
4 days ago
* @method static \Illuminate\Database\Eloquent\Builder<static>|Follower newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|Follower newQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|Follower query()
* @method static \Illuminate\Database\Eloquent\Builder<static>|Follower whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Follower whereFollowingId($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Follower whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Follower whereLocalFollowing($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Follower whereLocalProfile($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Follower whereNotify($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Follower whereProfileId($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Follower whereShowReblogs($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Follower whereUpdatedAt($value)
4 days ago
*
4 days ago
* @mixin \Eloquent
*/
class Follower extends Model
{
protected $guarded = [];
const MAX_FOLLOWING = 7500;
9 months ago
const FOLLOW_PER_HOUR = 150;
public function actor()
{
return $this->belongsTo(Profile::class, 'profile_id', 'id');
}
public function target()
{
return $this->belongsTo(Profile::class, 'following_id', 'id');
}
public function profile()
{
return $this->belongsTo(Profile::class, 'following_id', 'id');
}
public function permalink($append = null)
{
$path = $this->actor->permalink("#accepts/follows/{$this->id}{$append}");
9 months ago
return url($path);
}
}