<?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: Khandokar Nafis Jaman</title>
    <description>The latest articles on DEV Community by Khandokar Nafis Jaman (@nafisnil).</description>
    <link>https://dev.to/nafisnil</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%2F896286%2F6595c906-a89a-45b2-a830-97078603505b.jpeg</url>
      <title>DEV Community: Khandokar Nafis Jaman</title>
      <link>https://dev.to/nafisnil</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nafisnil"/>
    <language>en</language>
    <item>
      <title>latest() vs oldest() vs orderBy() in Laravel</title>
      <dc:creator>Khandokar Nafis Jaman</dc:creator>
      <pubDate>Sat, 19 Aug 2023 15:24:01 +0000</pubDate>
      <link>https://dev.to/nafisnil/latest-vs-oldest-vs-orderby-in-laravel-1pli</link>
      <guid>https://dev.to/nafisnil/latest-vs-oldest-vs-orderby-in-laravel-1pli</guid>
      <description>&lt;p&gt;To fetch sort data, we use &lt;em&gt;latest&lt;/em&gt;, &lt;em&gt;oldest&lt;/em&gt; and &lt;em&gt;orderBy&lt;/em&gt; methods in &lt;strong&gt;laravel&lt;/strong&gt;. The difference of these methods is: &lt;em&gt;latest&lt;/em&gt; and &lt;em&gt;oldest&lt;/em&gt; methods sort data according to the &lt;em&gt;created_at&lt;/em&gt; column whereas &lt;em&gt;orderBy&lt;/em&gt; methods sort data by the lexically. &lt;/p&gt;

&lt;p&gt;Suppose, you have a table called post and you want to use &lt;em&gt;latest&lt;/em&gt; methods, the syntax will be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$posts = DB::table('posts')-&amp;gt;latest()-&amp;gt;get();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will sort data based on &lt;em&gt;created_at&lt;/em&gt; column. And the syntax of the oldest methods is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$posts = DB::table('posts')-&amp;gt;oldest()-&amp;gt;get();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can pass a column as a parameter. Let's say, I want, the data will be sorted based on title column. So, the syntax will be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$posts = DB::table('posts')-&amp;gt;latest('title')-&amp;gt;get();
\\or
$posts = DB::table('posts')-&amp;gt;oldest('title')-&amp;gt;get();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On the contrary, &lt;em&gt;orderBy&lt;/em&gt; sort data lexically.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$posts = DB::table('posts')-&amp;gt;orderBy('title')-&amp;gt;get(); \\ascending
\\or
$posts = DB::table('posts')-&amp;gt;orderBy('title', 'desc')-&amp;gt;get(); \\ descending
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thanks. happy coding!&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>database</category>
      <category>php</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Rename column name in laravel migration</title>
      <dc:creator>Khandokar Nafis Jaman</dc:creator>
      <pubDate>Wed, 09 Aug 2023 10:39:52 +0000</pubDate>
      <link>https://dev.to/nafisnil/rename-column-name-in-laravel-migration-26j5</link>
      <guid>https://dev.to/nafisnil/rename-column-name-in-laravel-migration-26j5</guid>
      <description>&lt;p&gt;If you want to change the columns name of an existing table, at first you need to write the following way. Suppose we have a table name &lt;em&gt;users&lt;/em&gt; . So we need to run the following command first.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan make:migration rename_description_to_content_on_users_table --table=users
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then, a new migration file will be created. Let's say, there is a column name &lt;em&gt;description&lt;/em&gt;. I want to change this name to '&lt;em&gt;bio&lt;/em&gt;'. So now, I need to edit the migration file like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        Schema::table('users', function (Blueprint $table) {
            //
            $table-&amp;gt;renameColumn('description', 'bio');
        });

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

&lt;/div&gt;



&lt;p&gt;Then run, &lt;em&gt;php artisan migrate&lt;/em&gt; command. And done!&lt;/p&gt;

&lt;p&gt;Thanks. Happy coding!&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>migration</category>
      <category>php</category>
      <category>table</category>
    </item>
    <item>
      <title>Check database information by laravel command...</title>
      <dc:creator>Khandokar Nafis Jaman</dc:creator>
      <pubDate>Tue, 08 Aug 2023 08:24:33 +0000</pubDate>
      <link>https://dev.to/nafisnil/check-database-information-by-laravel-command-25lj</link>
      <guid>https://dev.to/nafisnil/check-database-information-by-laravel-command-25lj</guid>
      <description>&lt;p&gt;If you want to see the details of your database, you just need to type this on your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan db:show
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will show the basic configuration of your database which is attached on your projects. As well as, you can see total number of tables and connections. &lt;br&gt;
Now, you may have more than one database connected with your projects. If you wanna see a certain database details, you need to type&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan db:show --database=sqlite
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan db:show --database=pgsql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thanks. Happy coding!!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Flatlist in React-Native</title>
      <dc:creator>Khandokar Nafis Jaman</dc:creator>
      <pubDate>Wed, 12 Jul 2023 19:19:26 +0000</pubDate>
      <link>https://dev.to/nafisnil/flatlist-in-react-native-3fna</link>
      <guid>https://dev.to/nafisnil/flatlist-in-react-native-3fna</guid>
      <description>&lt;p&gt;The component known as React Native FlatList makes it possible to render lists with minimal effort and code. &lt;br&gt;
Flatlist can be done in &lt;em&gt;vertical&lt;/em&gt; and &lt;em&gt;horizontal&lt;/em&gt; way. We can also make a grid view using Flatlist. We can make the item of the list clickable. Let's see a example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { Component } from 'react';
import { View, FlatList, Text, Image, Alert } from 'react-native';
class App extends Component {
  //create json array
  MyData=[
    {id:'1',title:"Bangladesh", subtitle:"Sakib", img:"https://cdn.pixabay.com/photo/2023/05/15/09/18/iceberg-7994536_1280.jpg"},
    {id:'2',title:"Australia", subtitle:"Smith", img:"https://cdn.pixabay.com/photo/2023/03/17/02/42/architecture-7857832_1280.jpg"},
    {id:'3',title:"England", subtitle:"Anderson", img:"https://media.istockphoto.com/id/1172437911/photo/budapest-hungary-the-main-tower-of-the-famous-fishermans-bastion-from-above.jpg?s=1024x1024&amp;amp;w=is&amp;amp;k=20&amp;amp;c=WDvMoCZDycINy23u9r31noMQU28nZz_kBP27_vvEKOo="},
    {id:'4',title:"India", subtitle:"Kohli",img:"https://media.istockphoto.com/id/1172437974/photo/budapest-hungary-aerial-view-of-the-main-tower-of-fishermans-bastion-with-illuminated.jpg?s=1024x1024&amp;amp;w=is&amp;amp;k=20&amp;amp;c=Kn5Jz6qaUwT_qBwwf5Ljq-bPOAf4je7uS-CWfUIC5Hc="},
    {id:'5',title:"Pakistan", subtitle:"RIzwan",img:"https://media.istockphoto.com/id/1285333630/photo/turkey-aerial-drone-high-point-view.jpg?s=1024x1024&amp;amp;w=is&amp;amp;k=20&amp;amp;c=JXt3dk3JO-ysRwCTdPLAOYNvHE0EYGSmvwom4Nok5-E="},
    {id:'6',title:"New-zealand", subtitle:"Boult",img:"https://cdn.pixabay.com/photo/2023/06/28/20/15/spider-8095142_1280.jpg"},
    {id:'7',title:"South Africa", subtitle:"De kock",img:"https://cdn.pixabay.com/photo/2023/06/11/08/52/waves-8055488_1280.jpg"},
    {id:'8',title:"Zimbabwe", subtitle:"Raza",img:"https://cdn.pixabay.com/photo/2023/06/28/09/12/waterfalls-8093877_1280.jpg"},
    {id:'9',title:"Ireland", subtitle:"Campher",img:"https://cdn.pixabay.com/photo/2023/06/01/05/58/clouds-8032705_1280.jpg"},
    {id:'10',title:"Afghanistan", subtitle:"Rashid",img:"https://cdn.pixabay.com/photo/2023/06/02/17/28/nature-8036126_1280.png"},
    {id:'11',title:"England", subtitle:"Root",img:"https://cdn.pixabay.com/photo/2023/06/28/20/15/spider-8095142_1280.jpg"},
    {id:'12',title:"Bangladesh", subtitle:"Hasan",img:"https://cdn.pixabay.com/photo/2023/03/17/02/42/architecture-7857832_1280.jpg"},
    {id:'13',title:"Ireland", subtitle:"Tector",img:"https://cdn.pixabay.com/photo/2023/06/28/11/25/man-8094211_1280.jpg"},
    {id:'14',title:"England", subtitle:"Butler",img:"https://cdn.pixabay.com/photo/2023/06/15/13/50/coffee-machine-8065457_1280.jpg"},
    {id:'15',title:"Bangladesh", subtitle:"Towhid",img:"https://cdn.pixabay.com/photo/2023/07/04/07/25/self-consciousness-8105584_1280.jpg"},
  ];

  //clickable function
    onClickItem=(alertTitle)=&amp;gt;{
      Alert.alert(alertTitle)
    }
  childView=({ctitle, csubtitle, img})=&amp;gt;{
    return(
    /* vertical  
    &amp;lt;View style={{flexDirection:'row',backgroundColor:'#fffeed',margin:5, padding:10, flex:100}}&amp;gt;
        &amp;lt;View style={{flex: 30}}&amp;gt;
            &amp;lt;Image style={{height:50, width:60}} source={{uri:img}} /&amp;gt;
        &amp;lt;/View&amp;gt;

        &amp;lt;View style={{flex: 70, backgroundColor:'#fffdee',}}&amp;gt;
          &amp;lt;Text style={{color:'#123eed',fontSize:16}}&amp;gt;{ctitle}&amp;lt;/Text&amp;gt;
          &amp;lt;Text style={{color:'#23112f',fontSize:16}}&amp;gt;{csubtitle}&amp;lt;/Text&amp;gt;
        &amp;lt;/View&amp;gt;

      &amp;lt;/View&amp;gt;*/

    /*horizontql       
    &amp;lt;View style={{flexDirection:'column',width:120,height:180,backgroundColor:'#fabcdf',margin:5, padding:10,}}&amp;gt;
        &amp;lt;View &amp;gt;
            &amp;lt;Image style={{height:120, width:"100%"}} source={{uri:img}} /&amp;gt;
        &amp;lt;/View&amp;gt;

        &amp;lt;View style={{ backgroundColor:'#fabcde',}}&amp;gt;
          &amp;lt;Text style={{color:'#123eed',fontSize:16}}&amp;gt;{ctitle}&amp;lt;/Text&amp;gt;
          &amp;lt;Text style={{color:'#23112f',fontSize:16}}&amp;gt;{csubtitle}&amp;lt;/Text&amp;gt;
        &amp;lt;/View&amp;gt;

      &amp;lt;/View&amp;gt;
     */
    //grid view
      &amp;lt;View style={{flexDirection:'column',width:120,height:180,backgroundColor:'#fabcdf',margin:5, padding:10,}}&amp;gt;
      &amp;lt;View &amp;gt;
          &amp;lt;Image style={{height:120, width:"100%"}} source={{uri:img}} /&amp;gt;
      &amp;lt;/View&amp;gt;

      &amp;lt;View style={{ backgroundColor:'#fabcde',}}&amp;gt;
        &amp;lt;Text onPress={this.onClickItem.bind(this,ctitle)} style={{color:'#123eed',fontSize:16}}&amp;gt;{ctitle}&amp;lt;/Text&amp;gt;
        &amp;lt;Text style={{color:'#23112f',fontSize:16}}&amp;gt;{csubtitle}&amp;lt;/Text&amp;gt;
      &amp;lt;/View&amp;gt;

    &amp;lt;/View&amp;gt;
    )
  }
  render() {
    return (
    //   &amp;lt;FlatList horizontal={true} data={this.MyData} renderItem={({item}) =&amp;gt; &amp;lt;this.childView ctitle={item.title} csubtitle={item.subtitle} img={item.img}/&amp;gt;}/&amp;gt;
    &amp;lt;FlatList numColumns={3} horizontal={false} data={this.MyData} renderItem={({item}) =&amp;gt; &amp;lt;this.childView ctitle={item.title} csubtitle={item.subtitle} img={item.img}/&amp;gt;}/&amp;gt;
    );
  }
}

export default App;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hope, you can get benefited from it. Thanks in advance.&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>flatlist</category>
      <category>javascript</category>
      <category>react</category>
    </item>
    <item>
      <title>Create parallax effect of a 2D game background (Unity3D)</title>
      <dc:creator>Khandokar Nafis Jaman</dc:creator>
      <pubDate>Thu, 29 Sep 2022 18:50:33 +0000</pubDate>
      <link>https://dev.to/nafisnil/create-parallax-effect-of-a-2d-game-background-unity3d-2ked</link>
      <guid>https://dev.to/nafisnil/create-parallax-effect-of-a-2d-game-background-unity3d-2ked</guid>
      <description>&lt;p&gt;We often see the &lt;em&gt;parallax effect&lt;/em&gt; in the background of 2D games.  We can easily make this with Unity3D. To do this, we need to create a material. Change the shader type to &lt;strong&gt;Unlit/Texture&lt;/strong&gt;.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Funxlpsq6uepr1gm8s1yt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Funxlpsq6uepr1gm8s1yt.png" alt="Image description" width="541" height="468"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then select the background texture. Create a Quad. Resize it. Drag the material into material portion in &lt;em&gt;mesh renderer&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwotabsbla9r5joqwa40o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwotabsbla9r5joqwa40o.png" alt="Image description" width="543" height="1109"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create a script name "Parallax" and attach to the &lt;em&gt;quad&lt;/em&gt;. Open the script and paste the code.&lt;/p&gt;

&lt;p&gt;`&lt;br&gt;
using System.Collections;&lt;br&gt;
using System.Collections.Generic;&lt;br&gt;
using UnityEngine;&lt;/p&gt;

&lt;p&gt;public class Parallax : MonoBehaviour&lt;br&gt;
{&lt;br&gt;
    MeshRenderer meshRenderer;&lt;br&gt;
    [SerializeField]float animationSpeed = .5f;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private void Awake()
{
    meshRenderer = GetComponent&amp;lt;MeshRenderer&amp;gt;();
}
// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{
    meshRenderer.material.mainTextureOffset += new Vector2(animationSpeed * Time.deltaTime, 0);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;br&gt;
`&lt;/p&gt;

&lt;p&gt;Here the &lt;em&gt;mesh renderer&lt;/em&gt; attribute access the background material. We just change the offset value over frame so that it can rotate on &lt;em&gt;X axis&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F64uw08o151lef5ug2o7i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F64uw08o151lef5ug2o7i.png" alt="Image description" width="552" height="516"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's it. Your parallax background is ready for the game. &lt;/p&gt;

&lt;p&gt;Happy coding ☺️!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Laravel pagination: serial problem (serial starts with 0)</title>
      <dc:creator>Khandokar Nafis Jaman</dc:creator>
      <pubDate>Sun, 18 Sep 2022 04:54:59 +0000</pubDate>
      <link>https://dev.to/nafisnil/laravel-pagination-serial-problem-serial-starts-with-0-4n2c</link>
      <guid>https://dev.to/nafisnil/laravel-pagination-serial-problem-serial-starts-with-0-4n2c</guid>
      <description>&lt;p&gt;When you use Laravel default pagination, you may face a problem with its Key. If you use Key as the serial number, when you go to the second page, the key starts from 0. &lt;/p&gt;

&lt;p&gt;To fix this, several methods can be applied. There are some build-in function. But these have a version issue. That's why, I can show you a way without using build-in version.&lt;/p&gt;

&lt;p&gt;At first, let's see the url. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://pgnbd.com/registration/view?page=2"&gt;https://pgnbd.com/registration/view?page=2&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is the url when you are in second page. Similarly, when it's third page, the url is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://pgnbd.com/registration/view?page=3"&gt;https://pgnbd.com/registration/view?page=3&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So, we can catch the &lt;em&gt;page&lt;/em&gt; parameter into a variable by this.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;if(isset($_GET['page']))&lt;br&gt;
     $i=  $_GET['page']-1;&lt;br&gt;
  else&lt;br&gt;
     $i = 0;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;else&lt;/em&gt; portion is for the first page where you can't find any page parameter. Suppose you show 20 data in a page using paginate like this &lt;code&gt;paginate(20)&lt;/code&gt;. Then you can write the serial number like this.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;@foreach ($gallery as $key=&amp;gt;$item)&lt;br&gt;
       {{($key+1) + ($i*20)}}&lt;br&gt;
  @endforeach&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Happy coding 😎!!&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>paginate</category>
      <category>webdev</category>
    </item>
    <item>
      <title>As vs Prefix (Laravel Route)</title>
      <dc:creator>Khandokar Nafis Jaman</dc:creator>
      <pubDate>Wed, 14 Sep 2022 19:01:31 +0000</pubDate>
      <link>https://dev.to/nafisnil/as-vs-prefix-laravel-route-1pfe</link>
      <guid>https://dev.to/nafisnil/as-vs-prefix-laravel-route-1pfe</guid>
      <description>&lt;p&gt;When we work with a route group, we often find two terms -  'prefix' and 'as'. What's the difference between these two terms? Well, Prefix uses in URL and As is used in name route.&lt;/p&gt;

&lt;p&gt;For example, if we write...&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Route::group(['prefix' =&amp;gt; 'admin'], function(){&lt;br&gt;
        Route::get('/index',[DashboardController::class, 'index'])-&amp;gt;name('index');&lt;br&gt;
    });&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;the Url works like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Route::get('/admin/index',[DashboardController::class, 'index'])-&amp;gt;name('index');&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;But when we use &lt;strong&gt;As&lt;/strong&gt;,such as...&lt;br&gt;
&lt;code&gt;Route::group(['as' =&amp;gt; 'admin'], function(){&lt;br&gt;
        Route::get('/index',[DashboardController::class, 'index'])-&amp;gt;name('index');&lt;br&gt;
    });&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will be work like..&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Route::get('/index',[DashboardController::class, 'index'])-&amp;gt;name('admin.index');&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Thanks. Happy coding.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>webdev</category>
      <category>mvc</category>
    </item>
    <item>
      <title>Link a controller to a model Laravel.</title>
      <dc:creator>Khandokar Nafis Jaman</dc:creator>
      <pubDate>Tue, 13 Sep 2022 18:52:16 +0000</pubDate>
      <link>https://dev.to/nafisnil/link-a-controller-to-a-model-laravel-3jol</link>
      <guid>https://dev.to/nafisnil/link-a-controller-to-a-model-laravel-3jol</guid>
      <description>&lt;p&gt;Let's say, you want to create a resources controller and a model by a single command. Most of us know that command. Suppose the model is 'User'. So the command will be&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;php artisan make:model User -mcr&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But, when you want to connect a resources controller with an existing model, well, there is option here....&lt;/p&gt;

&lt;p&gt;You need to write the following command. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;php artisan make:controller UserController -m User&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Thank you. Happy coding!&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>mvc</category>
      <category>controller</category>
    </item>
    <item>
      <title>Slowly move gameobject from one place to another in Unity3D</title>
      <dc:creator>Khandokar Nafis Jaman</dc:creator>
      <pubDate>Sun, 21 Aug 2022 17:38:00 +0000</pubDate>
      <link>https://dev.to/nafisnil/slowly-move-gameobject-from-one-place-to-another-in-unity3d-4b0o</link>
      <guid>https://dev.to/nafisnil/slowly-move-gameobject-from-one-place-to-another-in-unity3d-4b0o</guid>
      <description>&lt;p&gt;Sometimes we need to move a game object from one place to another and maintain the speed of movement. &lt;em&gt;Vector3.MoveTowards()&lt;/em&gt; can be the perfect solution for this. We need to create an empty gameobject and set the position where we need to move our gameobject. Then create another empty gameobject and make the previous two gameobject of it's child. &lt;br&gt;
Let's say, we need to move &lt;em&gt;DonkeyKong&lt;/em&gt; gameobject to the position of platformB. Then it can be like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpw1009a07thhvrb7ra5y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpw1009a07thhvrb7ra5y.png" alt="Image description" width="800" height="288"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, create a scripts, attach to the parent object and paste the following code.&lt;/p&gt;

&lt;p&gt;`using System.Collections;&lt;br&gt;
using System.Collections.Generic;&lt;br&gt;
using UnityEngine;&lt;/p&gt;

&lt;p&gt;public class PlatformMovement : MonoBehaviour&lt;br&gt;
{&lt;br&gt;
    private Vector3 pointA;&lt;br&gt;
    private Vector3 pointB;&lt;br&gt;
    Vector3 nextPos;&lt;br&gt;
    [SerializeField] float speed;&lt;br&gt;
    [SerializeField] Transform childTransform;&lt;br&gt;
    [SerializeField]&lt;br&gt;
    Transform transformB;&lt;br&gt;
    // Start is called before the first frame update&lt;br&gt;
    void Start()&lt;br&gt;
    {&lt;br&gt;
        pointA = childTransform.localPosition;&lt;br&gt;
        pointB = transformB.localPosition;&lt;br&gt;
        nextPos = pointB;&lt;br&gt;
    }&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Update is called once per frame
void Update()
{
    Move();
}

void Move()
{
    childTransform.localPosition = Vector3.MoveTowards(childTransform.localPosition, nextPos, speed*Time.deltaTime);

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

&lt;/div&gt;

&lt;p&gt;}&lt;br&gt;
`&lt;/p&gt;

&lt;p&gt;Then, set the variables to the inspector.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyo7dymommjgadt6f1xu9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyo7dymommjgadt6f1xu9.png" alt="Image description" width="800" height="291"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we want to move gameobject in a periodic motion, we need to add a couple of lines. &lt;/p&gt;

&lt;p&gt;`&lt;br&gt;
using System.Collections;&lt;br&gt;
using System.Collections.Generic;&lt;br&gt;
using UnityEngine;&lt;/p&gt;

&lt;p&gt;public class PlatformMovement : MonoBehaviour&lt;br&gt;
{&lt;br&gt;
    private Vector3 pointA;&lt;br&gt;
    private Vector3 pointB;&lt;br&gt;
    Vector3 nextPos;&lt;br&gt;
    [SerializeField] float speed;&lt;br&gt;
    [SerializeField] Transform childTransform;&lt;br&gt;
    [SerializeField]&lt;br&gt;
    Transform transformB;&lt;br&gt;
    // Start is called before the first frame update&lt;br&gt;
    void Start()&lt;br&gt;
    {&lt;br&gt;
        pointA = childTransform.localPosition;&lt;br&gt;
        pointB = transformB.localPosition;&lt;br&gt;
        nextPos = pointB;&lt;br&gt;
    }&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Update is called once per frame
void Update()
{
    Move();
}

void Move()
{
    childTransform.localPosition = Vector3.MoveTowards(childTransform.localPosition, nextPos, speed*Time.deltaTime);
  //check if the position of gameobject is changed  if(Mathf.Abs(Vector3.Distance(childTransform.localPosition, nextPos) ) &amp;lt;= .1f)
    {
        ChangeDestination();
    }
}

void ChangeDestination()
{
  //set the next position
    nextPos = nextPos != pointA ? pointA : pointB;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;`&lt;/p&gt;

</description>
      <category>unity3d</category>
      <category>csharp</category>
      <category>gamedev</category>
      <category>physi</category>
    </item>
    <item>
      <title>Coinbase api and laravel</title>
      <dc:creator>Khandokar Nafis Jaman</dc:creator>
      <pubDate>Sun, 21 Aug 2022 07:38:48 +0000</pubDate>
      <link>https://dev.to/nafisnil/coinbase-api-and-laravel-293p</link>
      <guid>https://dev.to/nafisnil/coinbase-api-and-laravel-293p</guid>
      <description>&lt;p&gt;I want to integrate my coinbase wallet to my laravel website as a payment gateway. Can anyone help me to find the proper guidelines or documentation?&lt;/p&gt;

&lt;p&gt;Thanks in advance&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Some useful VSCode extension to develop laravel app</title>
      <dc:creator>Khandokar Nafis Jaman</dc:creator>
      <pubDate>Mon, 08 Aug 2022 20:35:00 +0000</pubDate>
      <link>https://dev.to/nafisnil/some-useful-vscode-extension-to-develop-laravel-app-1mbc</link>
      <guid>https://dev.to/nafisnil/some-useful-vscode-extension-to-develop-laravel-app-1mbc</guid>
      <description>&lt;p&gt;When I'm working with web development, VSCode is my first choice. Because it is lightweight, easy to use, has flexible UI/UX and most significantly, lots of extensions are available here. I bet, these extensions really help you to code and save your bunch of time. Some of these extensions are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Laravel Blade Snippets&lt;/strong&gt;. Extension ID: onecentlin.laravel-blade&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most useful extension. Helps you to write syntax. It has autocomplete option. Such as, if you just write '&lt;em&gt;if&lt;/em&gt;', it completes your if else block..&lt;/p&gt;

&lt;p&gt;`&lt;br&gt;&lt;br&gt;
@if ()&lt;/p&gt;

&lt;p&gt;&lt;a class="mentioned-user" href="https://dev.to/else"&gt;@else&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;@endif&lt;br&gt;
`&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Laravel goto view&lt;/strong&gt;. Extension ID: codingyu.laravel-goto-view&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It helps you to navigate the file. &lt;br&gt;
&lt;code&gt;return view('&amp;lt;u&amp;gt;admin.cmessage.index&amp;lt;/u&amp;gt;',['cm'=&amp;gt;$cm]);&lt;/code&gt;&lt;br&gt;
In above code, if you perform &lt;em&gt;cntr+click&lt;/em&gt; in windows or &lt;em&gt;cmd+click&lt;/em&gt; in mac, it will open &lt;strong&gt;index.blade.php&lt;/strong&gt; file.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;laravel-goto-components&lt;/strong&gt;. Extension ID: naoray.laravel-goto-components&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Same as &lt;em&gt;goto view&lt;/em&gt;. But it is for component file. It's pretty much useful when you work will &lt;strong&gt;Livewire&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Laravel Artisan&lt;/strong&gt;. Extension ID: &lt;em&gt;ryannaddy.laravel-artisan&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This extension help you to run artisan command within visual studio&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Laravel Blade formatter&lt;/strong&gt;. Extension ID: shufo.vscode-blade-formatter&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One of the significant extension. Work with indent of blade syntax&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HTML CSS Support&lt;/strong&gt;. Extension ID: &lt;em&gt;ecmel.vscode-html-css&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Help you to write html and css snippets.&lt;/p&gt;

&lt;p&gt;Happy coding!!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Update vs Fixed Update? Unity3D</title>
      <dc:creator>Khandokar Nafis Jaman</dc:creator>
      <pubDate>Tue, 02 Aug 2022 11:23:00 +0000</pubDate>
      <link>https://dev.to/nafisnil/update-vs-fixed-update-unity3d-3jl1</link>
      <guid>https://dev.to/nafisnil/update-vs-fixed-update-unity3d-3jl1</guid>
      <description>&lt;p&gt;If you are a game developer, you are familiar with the terms &lt;em&gt;Update&lt;/em&gt;() and &lt;em&gt;FixedUpdate&lt;/em&gt;(). &lt;br&gt;
But many of us are perplexed about the difference. We all know, Update() is used when we need to update something in every frame. &lt;/p&gt;

&lt;p&gt;`   // Update is called once per frame&lt;br&gt;
    void Update()&lt;br&gt;
    {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;`&lt;br&gt;
But there is some issue with the Update method. &lt;br&gt;
Frame rate differs from device to device or game to game. In that case, if you use any physics method in &lt;em&gt;Update&lt;/em&gt; methods, it will not perform appropriately. To get rid of that, we should use the &lt;em&gt;FixedUpdate&lt;/em&gt; method.&lt;/p&gt;

&lt;p&gt;`&lt;br&gt;
    private void FixedUpdate()&lt;br&gt;
    {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;`&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;FixedUpdate&lt;/em&gt; function runs at a fixed interval independent of your game’s frame rate so that our function works in every fixed frame. So when we need to use  &lt;em&gt;Rigidbody&lt;/em&gt;, we need to use &lt;em&gt;FixedUpdate()&lt;/em&gt;. Such as, move the player or add force. &lt;/p&gt;

&lt;p&gt;Happy Coding!!&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
