get());
if ($counted < 20) {
	echo $counted . "/" . $counted;
} else {
	echo "20/" . $counted;
}
?>
            
         
        
        
            
                
                |  | Subject | Ticket ID | Priority | Last Replier | Last Activity | Reply DueorderBy('id', 'DESC')->paginate(20);?>
                     @foreach ($tickets  as $ticket ) | seen_by == null) {?> style="color:green;"  >
                        | id)->first();
                        $string = strip_tags($title->title);
                        if (strlen($string) > 40) {
                            $stringCut = substr($string, 0, 40);
                            $string = substr($stringCut, 0, strrpos($stringCut, ' ')).' ...'; 
                        }
                        $TicketData = App\Model\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->max('id');
                        $TicketDatarow = App\Model\Ticket\Ticket_Thread::where('id', '=', $TicketData)->first();
                        $LastResponse = App\User::where('id', '=', $TicketDatarow->user_id)->first(); 
                        if($LastResponse->role == "user") {
                            $rep = "#F39C12";
                            $username = $LastResponse->user_name;
                            } else { $rep = "#000"; $username = $LastResponse->first_name ." ". $LastResponse->last_name; 
                            if($LastResponse->first_name==null || $LastResponse->last_name==null) {
                                $username = $LastResponse->user_name;
                            }}   
                        $titles = App\Model\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->get();
                        $count = count($titles);
                        foreach($titles as $title)
                        {
                            $title = $title;
                        }   ?> | {{$string}}    ({!! $count!!}) | #{!! $ticket->ticket_number !!}priority_id)->first();?> | {{$priority->priority}} | {!! $username !!} | {!! $title->updated_at !!} |  | 
                @endforeach
                
            
            
                setPath(url('/ticket'))->render();?>