public function likeIt($user = null)
    {
        if (!$this->isLiked()) {
            $this->likes()->create([
                'user_id'=> $user ? $user->id : auth()->id()
            ]);
            $this->incrementCount();
        }
    }
public function likeIt($user = null)
    {
        if (!$this->isLiked()) {
            $this->likes()->create([
                'user_id'=> $user ? $user->id : auth()->id()
            ]);
            $this->incrementCount();
        }
    }
public function likeIt ( $ user = null ) { if ( ! $ this -> isLiked ( ) ) { $ this -> likes ( ) -> create ( [ 'user_id' => $ user ? $ user -> id : auth ( ) -> id ( ) ] ) ; $ this -> incrementCount ( ) ; } }
Like like by authenticated user
If any user is given like by that user
After liking, increments the like Count
@param null $user
Like like by authenticated user If any user is given like by that user After liking increments the like Count