$followers=DB::table('user_followers as f')->join('users as u', 'u.id', '=', 'f.follower_id')->leftJoin('user_followers AS b', function($join){$join->on('b.follower_id', '=', 'f.leader_id')->on('b.leader_id', '=', 'u.id');})->selectRaw(DB::raw("u.user_id,u.full_name,u.username,u.avatar,case when b.follower_id is null then 0when b.follower_id is not null and b.status=1 then 1else 2end as isFollowing,case when b.follower_id is null then 'Follow'when b.follower_id is not null and b.status=1 then 'Pending'else 'Following'end as isFollowing"))->where("f.leader_id",$authUserId)->paginate(5);;-----------------------------------------Mysql----------------------------------SELECTu.id,u.username,f.status,case when b.follower_id is null then -- No record in b if 3 didn't follow this user back.'User is not following back'else'User is following back'end as backFROMuser_followers f -- IDs of followers of user 3INNER JOIN users u -- User information of those followersON u.id = f.follower_idLEFT JOIN user_followers b -- Check if 3 follows them back.ON b.follower_id = f.leader_id andb.leader_id = u.idWHEREf.leader_id = 582
This document shows you how to configure AWS environment in Amazon EC2 with RDS Instance. We need to login in to AWS to start the configuration. http://aws.amazon.com Login screen for AWS Management console: First thing we have to select is region. On which region you want to deploy your server. I am going to select Oregon region here for my setup. 1. click on the launch instance button, 2. It redirects to following screen. Here we have to search for required operating system or select from list, here im selecting Ubuntu latest version 4. After selecting operating system, choose the instance type according to our requirement. Here I need lower configuration so choosing t2.micro type instance. 5. Click Next button, then you see the below screen. Here we to modify if any settings need to modify Like changing netwo...
Comments
Post a Comment