<?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: Fernando Lucas</title>
    <description>The latest articles on DEV Community by Fernando Lucas (@fernandolucasdev).</description>
    <link>https://dev.to/fernandolucasdev</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%2F1071766%2Fbb37f779-23ec-42dd-8feb-cf4160a1b309.jpeg</url>
      <title>DEV Community: Fernando Lucas</title>
      <link>https://dev.to/fernandolucasdev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fernandolucasdev"/>
    <language>en</language>
    <item>
      <title>Creating a Webview for Android Using Native Development with Java</title>
      <dc:creator>Fernando Lucas</dc:creator>
      <pubDate>Wed, 07 Jun 2023 13:34:20 +0000</pubDate>
      <link>https://dev.to/fernandolucasdev/android-development-creating-a-webview-of-your-website-2lcc</link>
      <guid>https://dev.to/fernandolucasdev/android-development-creating-a-webview-of-your-website-2lcc</guid>
      <description>&lt;p&gt;Last week, at the company where I work, it was necessary to create an application for our platform using React. Initially, the idea was to convert this application to React Native, but I suggested creating a WebView app instead. It worked! Now, I'd like to share how to create a WebView for Android using native development with Java.&lt;/p&gt;

&lt;p&gt;First of all, let's go over what you'll need:&lt;br&gt;
Java installed on your machine, Android Studio, and all the required system variables (for Windows). Below, I'm providing all the useful docs:&lt;/p&gt;

&lt;p&gt;Java - &lt;a href="https://docs.oracle.com/en/java/javase/11/install/index.html" rel="noopener noreferrer"&gt;docs oracle&lt;/a&gt;&lt;br&gt;
Android Studio - &lt;a href="https://developer.android.com/studio/install" rel="noopener noreferrer"&gt;Android Studio docs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you have set up the development environment, let's create our app:&lt;/p&gt;

&lt;p&gt;Open Android Studio and create an empty activity app. When your app is ready, clear everything in the activity_main.xml file. You might find a tag that displays a "Hello, World!" text on the screen. Remove it. After it, add the following code inside your androidx tag:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;WebView&lt;/span&gt;
    &lt;span class="na"&gt;android:id=&lt;/span&gt;&lt;span class="s"&gt;"@+id/webview"&lt;/span&gt;
    &lt;span class="na"&gt;android:layout_width=&lt;/span&gt;&lt;span class="s"&gt;"match_parent"&lt;/span&gt;
    &lt;span class="na"&gt;android:layout_height=&lt;/span&gt;&lt;span class="s"&gt;"match_parent"&lt;/span&gt;
&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;It creates an WebView Element in our app, that is displayed in all screen. Now, with Java, we must catch this element and render our website in it.&lt;/p&gt;

&lt;p&gt;put this code insed onCreate method in MainActivity.java:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;webView&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;findViewById&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="no"&gt;R&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;webview&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;webView&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;clearCache&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="nc"&gt;WebSettings&lt;/span&gt; &lt;span class="n"&gt;webSettings&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;webView&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getSettings&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;webSettings&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setJavaScriptEnabled&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;webView&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setWebViewClient&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;MyWebViewClient&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"your_website_without_/_in_the_end"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;webView&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;loadUrl&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a new private class to handle SSL errors:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyWebViewClient&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;WebViewClient&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nd"&gt;@Override&lt;/span&gt;
        &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;onReceivedSslError&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;WebView&lt;/span&gt; &lt;span class="n"&gt;view&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;SslErrorHandler&lt;/span&gt; &lt;span class="n"&gt;handler&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;SslError&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;handler&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;proceed&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code overrides the onReceivedSslError method to handle SSL errors and allow the WebView to proceed.&lt;/p&gt;

&lt;p&gt;What this code do? Firsr, we catch the webview element &lt;code&gt;webView = findViewById(R.id.webview);&lt;/code&gt;, and then, we clear the cache, enable JS, and set the client. Before, we just pass the URL and our webview is created.&lt;/p&gt;

&lt;p&gt;to generate an APK:&lt;/p&gt;

&lt;p&gt;Android Studio &amp;gt; Build &amp;gt; Build bundle(s) / APK(s) &amp;gt; Build APK(s)&lt;/p&gt;

&lt;p&gt;Conclusion:&lt;br&gt;
In this article, we learned how to create a WebView in Android using Java and Android Studio. By following these steps, you can easily display a website within your Android app using a WebView.&lt;/p&gt;

&lt;p&gt;Note: Make sure to replace "your_website_without_trailing_slash" with the actual URL of the website you want to display in the WebView.&lt;/p&gt;

&lt;p&gt;That's it! You now have a WebView app that can render web content in your Android application.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Creating a CRUD with Laravel - Simple and easy way</title>
      <dc:creator>Fernando Lucas</dc:creator>
      <pubDate>Tue, 06 Jun 2023 14:18:41 +0000</pubDate>
      <link>https://dev.to/fernandolucasdev/creating-a-crud-with-laravel-simple-and-easy-way-cf0</link>
      <guid>https://dev.to/fernandolucasdev/creating-a-crud-with-laravel-simple-and-easy-way-cf0</guid>
      <description>&lt;p&gt;To create a crud is an basic thing in programming. Today, I'll talk about creating a CRUD using Laravel framework. First of all, why to use Laravel, instead of pure PHP? Because Laravel is very pratice and useful framework, that allows us to manage our database in a vary simple way. So, let's go step by step:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1 - Configuring .env&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;the first thing we must do is configure a connection to our database. In our project's root we have an file named .env, and this file contains some important informations about our project and system. If you're forking a project fro git, probably you find the .end.example, you change it's name to .env end set all infomarmations it requires, incluing database:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DB_CONNECTION=your_connection_(mysql_example)
DB_HOST=your_host_(localhost_example)
DB_PORT=your_port(3307_example)
DB_DATABASE=your_databese_name
DB_USERNAME=your_username
DB_PASSWORD=your_password
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2 - Creating a Model&lt;/strong&gt;&lt;br&gt;
Configured .env, we can create a table. To create a table, in Laravel we can create ane migration:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;php artisan make:migration create_mytable_table&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;it will create a migration file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Database\Migrations\Migration&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Database\Schema\Blueprint&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Support\Facades\Schema&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;CreateRecordsTable&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Migration&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;up&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;Schema&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'mytable'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Blueprint&lt;/span&gt; &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;id&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'name'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'email'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;unique&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;timestamps&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;down&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;Schema&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;dropIfExists&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'mytable'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;you can see that the columns are defineds in up function, and we define the type of each column:&lt;/p&gt;

&lt;p&gt;to create a integer field: &lt;code&gt;$table-&amp;gt;integer('age');&lt;/code&gt;&lt;br&gt;
to create a text field: &lt;code&gt;$table-&amp;gt;text('description');&lt;/code&gt;&lt;br&gt;
to create a float field: &lt;code&gt;$table-&amp;gt;float('rating');&lt;/code&gt;&lt;br&gt;
to create a datetime field: &lt;code&gt;$table-&amp;gt;dateTime('birthdate');&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;after creating your fields, run migration&lt;/p&gt;

&lt;p&gt;&lt;code&gt;php artisan migrate&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;before, to create a model:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;php artisan make:model Record&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This command will generate a model file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;

&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Database\Eloquent\Model&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyTable&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Model&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="nv"&gt;$fillable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'your'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'atributes'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;So, it's everything ok to create our CRUD!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating an insert:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To create a insert, you can create one array where the key is our column's name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$dataAll&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s2"&gt;"Name"&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"Jhon"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"Email"&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"jhon@emailexample.com"&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The values can be defined from different sources, as an POST from some form in front end. And remembering: it must be defined in controller, following MVC patterns. &lt;/p&gt;

&lt;p&gt;Now, we just must to call our Model and create in the table, using our array:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nc"&gt;MyTable&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$dataAll&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This method is native of Eloquent ORM - &lt;a href="https://laravel.com/docs/10.x/eloquent" rel="noopener noreferrer"&gt;Laravel Eloquent doc&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creatig a Select From:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;1 - Select without where:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;to get all registers in our database, just:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MyTable&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;it put's all infomations in $data, and if we what to send this data to on view, to render this information to an user Laravel will automatically convert it to JSON. The same happens when we want to do a Select with some condition:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;1 - Select where:&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MyTable&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'age'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;23&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;it returns all registers where age equals 23 and put it in $data;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Doing one update:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To do an update in Laravel, is very simple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MyTable&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'age'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;23&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;'email'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'new@email.mail'&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we just must say where we want to update, and past in an array the key - column name and value - new value.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deleting data:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;to delete data in Laravel is very simple too:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nc"&gt;MyTable&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'age'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;23&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;delete&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this code will delete from database all registes where age equals 23.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>What is MVC pattern?</title>
      <dc:creator>Fernando Lucas</dc:creator>
      <pubDate>Wed, 26 Apr 2023 17:20:07 +0000</pubDate>
      <link>https://dev.to/fernandolucasdev/what-is-mvc-pattern-586h</link>
      <guid>https://dev.to/fernandolucasdev/what-is-mvc-pattern-586h</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is the MVC pattern?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;MVC pattern is a famous software architecture that separates the system and the development in 3 components - Model, View and Controller. Each component has its own function and communicates with others. MVC allows the code to be more organized and simple to keep and update.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Model&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In the Model, we process the data, make connections with the database and store data. Model is independent from View, that is, Model isn’t responsible for the way we show this data to the user. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;View&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;View is responsible for showing to the user the data, through an interface. That is, View is the user’s part. The user can send data, see data and take actions. In other words, the View is the front-end part.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Controller&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Controller is responsible for making a bridge between View and Model. Controller gets data, processes this data and sends this data to the Model. A simple and daily example is a login system. We have the Model, with a database and one table User. We have the interface, with two fields, maybe one is password field and a button. Between these two, we have the Controller. When we press the button ‘login’, We take this data and send it to the Controller, and it will check if this data exists in the database, and will make all the processes, if it exists or not. &lt;/p&gt;

</description>
      <category>development</category>
    </item>
    <item>
      <title>Using ChatGPT to learn anything</title>
      <dc:creator>Fernando Lucas</dc:creator>
      <pubDate>Wed, 26 Apr 2023 00:30:35 +0000</pubDate>
      <link>https://dev.to/fernandolucasdev/using-chatgpt-to-learn-anything-3cch</link>
      <guid>https://dev.to/fernandolucasdev/using-chatgpt-to-learn-anything-3cch</guid>
      <description>&lt;p&gt;Hi everybody! This is my first post here at Dev.to!&lt;br&gt;
I can see how useful the new technologies in the IA field are. I really believe that we’re living a time where a lot of things will change. And, it 's awesome!&lt;br&gt;
Today, I’m here to talk about one impressive thing the chatGPT can do: to teach! Some weeks ago, my friend and I were wanting to learn new frameworks. We choose react. Well, looking for a course or tutorials, I had one idea: if chatGPT is able to teach us? It was, more than surprisingly, very able to. &lt;/p&gt;

&lt;p&gt;With a command, it gave us all the step-to-step, study list, timeline, and a complete study plan to learn anything. I’ve been using it to learn frameworks, and… french!&lt;/p&gt;

&lt;p&gt;A command like:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ChatGPT, give me a complete study list, with timelines and steps, for learning French. Focusing on conversation and vocabulary&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With this command I get study steps based on weeks, what I should study in each week, and more additional tips. And ChatGPT can teach me grammar and vocabulary! &lt;/p&gt;

&lt;p&gt;But, aways remember: read the official documentation and check the informations are aways necessary.&lt;/p&gt;

</description>
      <category>chatgpt</category>
    </item>
  </channel>
</rss>
