<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: markplus</title>
    <description>The latest articles on DEV Community by markplus (@markplus).</description>
    <link>https://dev.to/markplus</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1021326%2Fa6762a06-fb69-4164-98f4-1c2e07df6e12.jpeg</url>
      <title>DEV Community: markplus</title>
      <link>https://dev.to/markplus</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/markplus"/>
    <language>en</language>
    <item>
      <title>Link details page to a second table via id</title>
      <dc:creator>markplus</dc:creator>
      <pubDate>Mon, 08 Apr 2024 11:14:02 +0000</pubDate>
      <link>https://dev.to/markplus/link-details-page-to-a-second-table-via-id-2gpn</link>
      <guid>https://dev.to/markplus/link-details-page-to-a-second-table-via-id-2gpn</guid>
      <description>&lt;p&gt;I created a page where I see the list correctly, now when I open the detail I have to connect another list to the details page, I created categoryID in the second table which is the ID of the first table, how can I do it to also see the data of the second table in the details page of the first table?&lt;/p&gt;

</description>
      <category>flutter</category>
    </item>
    <item>
      <title>Laravel count 3 tickets per time and display ticket number, date and results</title>
      <dc:creator>markplus</dc:creator>
      <pubDate>Sun, 05 Feb 2023 21:22:33 +0000</pubDate>
      <link>https://dev.to/markplus/laravel-count-3-tickets-per-time-and-display-ticket-number-date-and-results-2o6f</link>
      <guid>https://dev.to/markplus/laravel-count-3-tickets-per-time-and-display-ticket-number-date-and-results-2o6f</guid>
      <description>&lt;p&gt;I have already opened a discussion where I received help for some problems I had, now I would like to improve the code but I need help. I would like to display the ticket number, date and result in the same table which currently only displays the results of counting tickets every hour. Eventually I should have a complete table of data to view. I have to do the count from 07:00 to 15:00 every day and count the tickets every hour He currently works with a set date but I would like to automate the monthly count and thus have monthly reports for each year. Thanks to all who help me and give their contribution. the problem is that now i see the count but i can't insert the ticket_id and the created_at in the table too and i need to see these two fields too together with the count&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for ($month = 1; $month &amp;lt;= 12; $month++) {
            $startOfMonth = Carbon::now()-&amp;gt;startOfMonth();
            $endOfMonth = Carbon::now()-&amp;gt;endOfMonth();

            $uptimeData = Ticket::whereBetween('created_at', [$startOfMonth-&amp;gt;format('Y-m-d 07:00:00'), $endOfMonth-&amp;gt;format('Y-m-d 15:00:00')])
                        -&amp;gt;orderBy('created_at', 'asc')
                        -&amp;gt;select('ticket_Id', 'created_at')
                        -&amp;gt;get();
            $intervals = \Carbon\CarbonInterval::hours(1)-&amp;gt;toPeriod($startOfMonth, $endOfMonth);
            $uptimeDataTimeline = $uptimeData-&amp;gt;groupBy(function ($item, $key) use ($intervals) {
                $date = Carbon::parse($item-&amp;gt;created_at);
                foreach ($intervals as $key =&amp;gt; $interval) {
                    if ($date-&amp;gt;hour == Carbon::parse($interval)-&amp;gt;addHours(1)-&amp;gt;hour) {
                    $actualHour1 = Carbon::parse($interval)-&amp;gt;hour;
                    if (strlen($actualHour1) == 1) $actualHour1 = "0$actualHour1";
                    return $date-&amp;gt;format("Y-m-d $actualHour1:00:00");
                    }
                    else if ($date-&amp;gt;hour == Carbon::parse($interval)-&amp;gt;addHours(1)-&amp;gt;hour) {
                    $actualHour2 = Carbon::parse($interval)-&amp;gt;subHours(1)-&amp;gt;hour;
                    if (strlen($actualHour2) == 1) $actualHour2 = "0$actualHour2";
                    return $date-&amp;gt;format("Y-m-d $actualHour2:00:00");
                    }

                }
            return $date-&amp;gt;format('Y-m-d H:00:00');
            });

            $uptimeDataTimeline = $uptimeDataTimeline-&amp;gt;map(function($checksInPeriod, $key){
                $down = 0;
                $up = 0;
                $total = 0;
                $uptime = 0;
                $fill = '#1fc777';

                foreach($checksInPeriod as $key =&amp;gt; $value){
                    $total++;
                    if ($total &amp;lt;= 4) {
                        $up++;
                    } else {
                        $down++;
                    }
                }

                $uptime = floatval(number_format(round($up / $total, 5) * 100, 2, '.',','));

                if ($uptime &amp;lt; 100) $fill = '#9deab8';
                if ($uptime &amp;lt; 99) $fill = '#fbaa49';
                if ($uptime &amp;lt; 98) $fill = '#e0465e';

                return [
                    'total_ticket_Id' =&amp;gt; $total,
                    'down_ticket_Id' =&amp;gt; $down,
                    'up_ticket_Id' =&amp;gt; $up,
                    'uptime' =&amp;gt; $uptime,
                    'fill' =&amp;gt; $fill,
                ];
            });
        }

&amp;lt;tbody&amp;gt;                                         
  @foreach((array)$dataset as $ticket)
   &amp;lt;tr&amp;gt;
    &amp;lt;td&amp;gt;                                                       
      {{$ticket['created_at']}}
    &amp;lt;/td&amp;gt;
    &amp;lt;td&amp;gt;
      {{ $ticket['ticket_Id'] }}
    &amp;lt;/td&amp;gt;
   &amp;lt;/tr&amp;gt;
  @endforeach
&amp;lt;/tbody&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>devto</category>
      <category>announcement</category>
      <category>offers</category>
    </item>
  </channel>
</rss>
