talhaatsix

talhaatsix

Member Since 5 Months Ago

Experience Points 890
Experience Level 1

4,110 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 4
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

31 May
2 months ago

talhaatsix started a new conversation How To Design Notification Table For Social Networking Site

I need help to build notification system , im stuck with database design .

Posts Like 
Friend Request  
Follow User  
Send Message 
Comment on post 
Like Comments 
Reply Comment Post  

need suggestion

database design dont share laravel topic link

15 May
3 months ago

talhaatsix left a reply on Ambiguous Column Name Error |Load Relationship Error

@DEVFREY - Plz suggest title for this problem ... so it can helpful for others

talhaatsix left a reply on Ambiguous Column Name Error |Load Relationship Error

@DEVFREY - Thanks it fixed .

Just One Change

$pitches->select('id', 'slug', 'description', 'cover', 
            'title', 'investment_required', 'project_stage', 'share_percentage','privacy','projects.user_id');
14 May
3 months ago

talhaatsix started a new conversation Ambiguous Column Name Error |Load Relationship Error

    public function getInvestments(Request $request) {
            $user = $request->user();
            $user->load(['user_projects' => function ($pitches) use ($request) {
                $pitches->whereIn('status', ['confirmed', 'accepted']);
                $pitches->select('id', 'slug', 'description', 'cover', 
                'title', 'investment_required', 'project_stage', 'share_percentage','privacy','user_id');
                
                //Get Pitch with user info 
                $pitches->with(['user' => function ($query) {
                    $query->select('id','name','avatar');
                }]);

                //Get Pitch with pitch-team info
                $pitches->with(['project_teams' => function ($query) {
                    $query->select('avatar');
                }]);
                //Project Team Count    
                $pitches->withCount('project_teams');

                //Requested User Liked This Project (Pitch) ?
                $pitches->withCount(['projectLikes as is_liked' => function($query) use($request) {
                    $query->where('user_id', $request->user()->id);
                }]);
                //Get Project Likes
                $pitches->withCount(['projectLikes as project_likes']);

                //Requested User Liked This Project (Pitch) ?
                $pitches->withCount(['projectFollows as is_followed' => function($query) use($request) {
                    $query->where('user_id', $request->user()->id);
                }]);
                //Get Project Likes
                $pitches->withCount(['projectFollows as project_follows']);
            }]);
        $investments = $user->user_projects;
        return $this->success(200, ['pitches' => $investments], 'Success');
}

ERROR

"SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'user_id' in field list is ambiguous (SQL: select id, slug, description, cover, title, investment_required, project_stage, share_percentage, privacy, user_id AS aaa, (select count() from users inner join teams on users.id = teams.user_id where projects.id = teams.project_id) as project_teams_count, (select count() from project_likes where projects.id = project_likes.project_id and user_id = 5) as is_liked, (select count() from project_likes where projects.id = project_likes.project_id) as project_likes, (select count() from project_follows where projects.id = project_follows.project_id and user_id = 5) as is_followed, (select count(*) from project_follows where projects.id = project_follows.project_id) as project_follows, project_officials.user_id as pivot_user_id, project_officials.project_id as pivot_project_id from projects inner join project_officials on projects.id = project_officials.project_id where project_officials.user_id in (5) and status in (confirmed, accepted))"

30 Apr
3 months ago

talhaatsix started a new conversation Get List Of Records With Related Table Plus Count Of Related Records

$projects = Project::select('id', 'slug', 'description', 'cover', 'title', 'project_stage', 'user_id');

$projects->with(['project_teams' => function ($query) { $query->select('avatar')->take(3); }]);

$projects->orderBy('created_at', 'desc')->take(4); $projects = $projects->get() ;

Problem : I want projects with project team and team count with every project .

talhaatsix started a new conversation Get Projects With Team And Team Count

$projects = Project::select('id', 'slug', 'description', 'cover', 'title', 'project_stage', 'user_id');

$projects->with(['project_teams' => function ($query) { $query->select('avatar')->take(3); }]);

$projects->orderBy('created_at', 'desc')->take(4); $projects = $projects->get() ;

I want projects with project team and team count with every project .

08 Apr
4 months ago

talhaatsix started a new conversation Laravel Api - Authentication For Multiple User Devices .

How to design db for this .

And manage in code .

Send some kind Sample code .

User Multiple tokens for different devices like Fb .

im also implement linkined in , facebook for register user .

how to mange this user how register with linkedin and facebook ?

18 Mar
5 months ago

talhaatsix left a reply on Chat System - Laravel , Redis And Socket.io

@OUHARE - i need suggestion how can i design db for chat system. for one to one and group chat . and chat boxes like facebook .

im saving user online in db . for show his friends user1 in online .

problem when user1 is close his browser than , than how i can change status ?

talhaatsix left a reply on Chat System - Laravel , Redis And Socket.io

@OUHARE - Im using laravel echo .

plz check this flow is it ok .

User1 -> Send Msg -> Laravel -> Save in DB + Push in Redis -> Node Serve Socket.io Take msg -> Send User2. ?

talhaatsix started a new conversation Chat System - Laravel , Redis And Socket.io

I want build chat system with laravel .

im using laravel , Redis and socket.io (node-server) .

So , I want to know how this stack is work .

{User1 -> Send Msg -> Laravel -> Save in DB + Push in Redis -> Node Serve Socket.io Take msg -> Send User2. ??}

how i only restrict socket.io bradcast not for all connected user ..

1-1 Chat system ?

and which is best db design for chat system , single and group ....

04 Mar
5 months ago

talhaatsix left a reply on Laravel Api | Social Networking | Vuejs

@MUSHOOD - Hi ,

thanks for your help .

and for post (news feed) with user settings and also a single post (with public , private ,friends ) what i do?

public function getFeed(Request $req){

    //All Feed
   
       $friends = Friendship::where(['user_id' => $request->user()->id, 'is_confirmed' => 1])->pluck('friend_id')->toArray();
      $feeds = $feeds->where(function($feeds)use ($friends, $request, &$adminNewestFeedIds) {
                    $feeds = $feeds->where(function($feeds) use ($friends, $request) {
                        $feeds = $feeds->whereRaw("((((user_id IN ('" . implode("','", $friends) . "') ) )AND privacy <> 
                                                     'private') OR user_id = '" . $request->user()->id . "' )");
      });

the above is not a good approach

plz suggest something for fetching feed ..

01 Mar
5 months ago

talhaatsix left a reply on Laravel Api | Social Networking | Vuejs

@MUSHOOD - User Profile Settings .

User 1 -> Can See other User Profile . User have Settings for Profile . Email , Friends and Address . Email Can be Public Private Friends Friends Can be Public Private Friends Address Can be Public Private Friends Post Can be Public Private Friends

For Saving user settings users table -> friends_privacy , email_privacy , post_privacy Columns .

User 1 goes to User 2 Profile .

in controller im checking for $req->user_id!==$req->user()->id than i set $_REQUEST['check_privacy']

Than in User Model i created

 public function getAddressAttribute($value){
    if(!$this->checkPrivacyFor('location_privacy')){
        return "";
    }
    return $value;
}

  private function checkPrivacyFor($key){
    if(isset($_REQUEST['privacy_check']) && $_REQUEST['privacy_check']==true){
        if($this->$key=="Only Me"){
            return false;
        }elseif($this->$key=="Friends" && !$this->areFriends($_REQUEST['requested_user'])){
            return false;
        }elseif($this->$key=="Collaborators" && !$this->areATeam($_REQUEST['requested_user'])){
            if(!$this->areProjectOfficials($_REQUEST['requested_user']))
                return false;
        }
    }
    return true;
} 

this above code is in user model .

is it right approach .....

talhaatsix left a reply on How To Build A News-feed For A Social Networking Site?

@JAYTEE - hi , i working on social networking site . it an api in laravel . i added settings , user general settings and post settings . User general settings for posts -> public , private and friends . A single Post also have privacy settings public , private and friends .

My Question is how can i get my feeds and friends feeds with checks .

and one more thing i added share feature in post . what im doing im duplicating the post record and his attachments with share user id

talhaatsix started a new conversation Laravel Api | Social Networking | Vuejs

Hi I'm new in development . i learn laravel 5.7 .

need help to complete my sample project .

A Social Networking site

Users , Friends , Posts , Chat System , likes , Share .

1 ) how can i design db .

2 ) How to create api with custom auth and token multiple devices .

3 ) How Chat system design for 1-1 chat and group

4 ) Add settings in users for posts , public , private and friends

5 ) Single Post Privacy settings public , private and friends

6 ) Share Post (i'm duplicating the post with shared user_id)

7 ) Fetch posts on user newsfeed with checks Users post his friends posts and shared posts and privacy check posts . with pagination

if a user is my friends and his post is private .
if a user is my friends and his general settings for posts is private 

8 ) user pofile info settings his email and address , public private and friends .

i need help how to create this in laravel and is it possible in laravel