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

37 lines
761 B
PHTML

<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
Staging (#6264) * StatusPipeline defensive checks * HomeFeedPipeline defensive checks * DeletePipeline defensive checks * InboxPipeline defensive checks * MediaPipeline defensive checks * PushNotificationPipeline defensive checks * LikePipeline defensive checks * FollowPipeline defensive checks * ImageOptimizePipeline defensive checks * Misc pipelines defensive checks * Update CommentPipeline.php * Update FollowPushNotifyPipeline.php * Update LikePushNotifyPipeline.php * Update FollowPushNotifyPipeline.php * Update MentionPushNotifyPipeline.php * Update MoveSendUndoFollowPipeline.php * Update RemoteFollowPipeline.php * Update FollowPushNotifyPipeline.php * Update LikePushNotifyPipeline.php * Update MentionPushNotifyPipeline.php * Update Site/Config.php - config_cache only has 1 arg. No fallback. * Update Bouncer.php - Called 'count' on Laravel collection, but could have been retrieved as a query. 🪪 larastan.noUnnecessaryCollectionCall * Update Status.php - Missing use App\Models\Conversation; * Larastan: Update UndoSharePipeline.php (Undefined variable: $status) * Update ResilientMediaStorageService.php * Update ImageS3UploadPipeline.php * Larastan: Update Profile.php missing "use App\Avatar;" * Larastan: Update MediaStorageService.php * Larastan: Update MediaPathService.php * Update MediaPathService.php * Update MediaStorageService.php * Update ImageS3UploadPipeline.php * Larastan: Update AddUserDomainBlock.php ``` ------ ------------------------------------------------------------- Line Console/Commands/AddUserDomainBlock.php ------ ------------------------------------------------------------- 37 Variable $domain in empty() always exists and is not falsy. 🪪 empty.variable ------ ------------------------------------------------------------- ``` * Larastan: Update CatchUnoptimizedMedia.php ``` ------ ------------------------------------------------------------------------------------------------- Line Console/Commands/CatchUnoptimizedMedia.php ------ ------------------------------------------------------------------------------------------------- 31 Constructor of class App\Console\Commands\CatchUnoptimizedMedia has an unused parameter $media. 🪪 constructor.unusedParameter ------ ------------------------------------------------------------------------------------------------- ``` * Update DeleteUserDomainBlock.php * Update StatusHashtag.php * Update FixLikes.php * Update User.php * Update Installer.php * Update SeedFollows.php * Update DiscoverCategory.php * Update FollowRequest.php * Update Follower.php * Update AccountController.php * Update CustomFilterKeyword.php * Update FederationController.php * Update Inbox.php * Update HttpSignature.php --------- Co-authored-by: Your Name <you@example.com> Co-authored-by: Shlee <github@shl.ee>
2 weeks ago
use App\Profile;
class Follower extends Model
{
protected $fillable = ['profile_id', 'following_id', 'local_profile'];
const MAX_FOLLOWING = 7500;
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}");
return url($path);
}
}