1. Go to this page and download the library: Download kayw-geek/yii2-follow library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kayw-geek / yii2-follow example snippets
use kaywGeek\follow\FollowerTrait;
use Yii;
use yii\base\NotSupportedException;
use yii\behaviors\TimestampBehavior;
use yii\db\ActiveRecord;
use yii\web\IdentityInterface;
class User extends ActiveRecord implements IdentityInterface
{
<...>
use FollowerTrait;
<...>
}
// with query where
$user->followings()->where(['<',['follow_at'=>date('Y-m-d')]])->all();
// followers orderBy
$user->followers()->orderBy('follow_at desc');
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.