<?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: Laravel Indonesia</title>
    <description>The latest articles on DEV Community by Laravel Indonesia (@laravelindonesia).</description>
    <link>https://dev.to/laravelindonesia</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%2F859171%2F1929188a-a3c1-4f76-9627-b53197d19ad3.png</url>
      <title>DEV Community: Laravel Indonesia</title>
      <link>https://dev.to/laravelindonesia</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/laravelindonesia"/>
    <language>en</language>
    <item>
      <title>Python Buble Sort In Action</title>
      <dc:creator>Laravel Indonesia</dc:creator>
      <pubDate>Fri, 13 May 2022 21:19:30 +0000</pubDate>
      <link>https://dev.to/laravelindonesia/python-buble-sort-in-action-4kb5</link>
      <guid>https://dev.to/laravelindonesia/python-buble-sort-in-action-4kb5</guid>
      <description>&lt;p&gt;Write a Python program to sort a list of elements using the bubble sort algorithm.&lt;br&gt;
Note : According to Wikipedia "Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps through the list to be sorted, compares each pair of adjacent items and swaps them if they are in the wrong order. The pass through the list is repeated until no swaps are needed, which indicates that the list is sorted. &lt;/p&gt;

&lt;p&gt;The algorithm, which is a comparison sort, is named for the way smaller elements "bubble" to the top of the list. Although the algorithm is simple, it is too slow and impractical for most problems even when compared to insertion sort. It can be practical if the input is usually in sort order but may occasionally have some out-of-order elements nearly in position.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample input&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;[2,4,3,1]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Output&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;[1,2,3,4]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Solution&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/g_xAhmMr2n0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Source : &lt;a href="https://www.w3resource.com/python-exercises/data-structures-and-algorithms/python-search-and-sorting-exercise-4.php"&gt;https://www.w3resource.com/python-exercises/data-structures-and-algorithms/python-search-and-sorting-exercise-4.php&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>algorithms</category>
      <category>programming</category>
    </item>
    <item>
      <title>Laravel 9 Multi Update or Insert with this 'Magic'</title>
      <dc:creator>Laravel Indonesia</dc:creator>
      <pubDate>Sat, 07 May 2022 19:40:08 +0000</pubDate>
      <link>https://dev.to/laravelindonesia/laravel-9-multi-update-or-insert-with-this-magic-mpb</link>
      <guid>https://dev.to/laravelindonesia/laravel-9-multi-update-or-insert-with-this-magic-mpb</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyqr5eddmmq8tz2nxm8ze.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyqr5eddmmq8tz2nxm8ze.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
Laravel includes Eloquent, an object-relational mapper (ORM) that makes it enjoyable to interact with your database. When using Eloquent, each database table has a corresponding "Model" that is used to interact with that table. In addition to retrieving records from the database table, Eloquent models allow you to insert, update, and delete records from the table as well.&lt;/p&gt;

&lt;p&gt;If you would like to perform multiple "&lt;em&gt;upserts&lt;/em&gt;" in a single query, then you should use the upsert method instead. The method's first argument consists of the values to insert or update, while the second argument lists the column(s) that uniquely identify records within the associated table. The method's third and final argument is an array of the columns that should be updated if a matching record already exists in the database. The upsert method will automatically set the created_at and updated_at timestamps if timestamps are enabled on the model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if(count($data) &amp;gt; 0) {
   $error = '';
}
PostNilai::upsert($data,['id','user_id','nilai_id','score_s1','score_s2','score_s3','score_s4','score_s5']);
return redirect(route('nilai'))-&amp;gt;with('error', $error);

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;
  watch full tutorial
  &lt;br&gt;
&lt;a href="https://youtu.be/eMBS80A2SzI" rel="noopener noreferrer"&gt;https://youtu.be/eMBS80A2SzI&lt;/a&gt;&lt;br&gt;


&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
    </item>
  </channel>
</rss>
