avztemeleqi
2 months ago
310
4
Laravel

Laravel Member Filtering

Posted 2 months ago by avztemeleqi

Hello Everyone This is My First Form Discussion

I want to make a change to my Laravel application, but I couldn't.

The error is this:

A user is adding a forum to the site. This forum seems to be the task. However, I do not want other members to see this. I just want that member to see. But I couldn't.

ProjectTaskController.php

if($users = $task->users())
    
    {
        $html .= '<div class="avatar-group">';
        foreach($users as $key => $user)
        {
            if($key < 3)
            {
                $html .= ' <a href="#" class="avatar rounded-circle avatar-sm">';
                $html .= '<img ' . $user->img_avatar . ' title="' . $user->name . '">';
                $html .= '</a>';
            }
        }

        if(count($users) > 3)
        {
            $html .= '<a href="#" class="avatar rounded-circle avatar-sm"><img avatar="';
            $html .= count($users) - 3;
            $html .= '"></a>';
        }
        $html .= '</div>';
    }
    $html .= '</div></div></div>';

    print_r($html);
}

If there is another part I should throw, I will throw it. I don't know very well about Laravel

Thank you from now

Please sign in or create an account to participate in this conversation.