<?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: Shahadat Hossain</title>
    <description>The latest articles on DEV Community by Shahadat Hossain (@mshossain110).</description>
    <link>https://dev.to/mshossain110</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%2F155001%2F2a09a2df-ed69-45d7-ace1-abca65fa020a.jpeg</url>
      <title>DEV Community: Shahadat Hossain</title>
      <link>https://dev.to/mshossain110</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mshossain110"/>
    <language>en</language>
    <item>
      <title>Recap the highlight of the sorting algorithms using JavaScript for beginners</title>
      <dc:creator>Shahadat Hossain</dc:creator>
      <pubDate>Sat, 05 Oct 2024 15:45:01 +0000</pubDate>
      <link>https://dev.to/mshossain110/recap-the-highlight-of-the-sorting-algorithms-using-javascript-for-beginners-k9n</link>
      <guid>https://dev.to/mshossain110/recap-the-highlight-of-the-sorting-algorithms-using-javascript-for-beginners-k9n</guid>
      <description>&lt;p&gt;Sorting algorithms are methods used to arrange elements of a list or array in a specific order, typically numerical or lexicographical. They are fundamental in computer science for organizing data efficiently. It is an exercise in understanding how to break down a problem into steps and then implement those steps, i.e., how to create an algorithm. It's also an exercise in realizing that there are multiple methods to tackle an issue, and some are superior to others.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why should I learn it?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;It's a simple practical example for thinking recursively (see: merge sort and quick sort) and divide and conquer.&lt;/li&gt;
&lt;li&gt;It's a simple but nontrivial example for algorithmic analysis (I.e. big O).&lt;/li&gt;
&lt;li&gt;It's a traditional intro computer science topic that is expected to be taught.&lt;/li&gt;
&lt;li&gt;It's a simple example to motivate why you might care about having a better algorithm than the simplest native one (I.e. bubble sort).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here are some common sorting algorithms&lt;/p&gt;

&lt;h2&gt;
  
  
  Bubble Sort
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Repeatedly swaps adjacent elements if they are in the wrong order.&lt;br&gt;
&lt;strong&gt;Time Complexity:&lt;/strong&gt; O(n²) &lt;br&gt;
&lt;strong&gt;Use Case:&lt;/strong&gt; Simple but inefficient for large datasets.&lt;br&gt;
&lt;strong&gt;&lt;a href="https://gist.github.com/mshossain110/a9d7645bf8dd066cd984e0b7d9638502" rel="noopener noreferrer"&gt;Bubble Sort GitHub Gist&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var arr = [10, 55, 20, 4, 28, 69, 22, 85, 7, 37];

function bubbleSort(arr)
{
    var temp, i, j;

    for(i = 0; i&amp;lt;arr.length; i++)
    {
        for(j = 0; j&amp;lt; arr.length; j++)
        {
            if (arr[j] &amp;gt; arr[j+1])
            {
                temp = arr[j];
                arr[j] = arr[j+1];
                arr[j+1] = temp;
            }
        }
    }

    return arr;
}

console.log(bubbleSort(arr));

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Selection Sort
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Selects the smallest element from the unsorted part and swaps it with the first unsorted element.&lt;br&gt;
&lt;strong&gt;Time Complexity:&lt;/strong&gt; O(n²)&lt;br&gt;
&lt;strong&gt;Use Case:&lt;/strong&gt; Inefficient for large datasets but easy to implement.&lt;br&gt;
&lt;strong&gt;&lt;a href="https://gist.github.com/mshossain110/ca25498ba1ee9ac840cfa18b38f2541e" rel="noopener noreferrer"&gt;Selection Sort GitHub Gist&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var arr = [10, 55, 20, 4, 28, 69, 22, 85, 7, 37];

function selectionSort(arr)
{
   var min;
   for(var i = 0; i &amp;lt; arr.length; i++)
   {
       min = i;
       for(var j = i+1; j &amp;lt; arr.length; j++ )
       {
           if (arr[j] &amp;lt; arr[min])
           {
               min = j;
           }
       }


       if (min !== i) {
           var s = arr[min];
           arr[min] = arr[i];
           arr[i] = s;
       }
   }

   return arr;
}

console.log(selectionSort(arr));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Insertion Sort
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Builds the sorted list one element at a time by inserting each element into its correct position.&lt;br&gt;
&lt;strong&gt;Time Complexity:&lt;/strong&gt; O(n²)&lt;br&gt;
&lt;strong&gt;Use Case:&lt;/strong&gt; Good for small datasets or nearly sorted arrays.&lt;br&gt;
&lt;strong&gt;&lt;a href="https://gist.github.com/mshossain110/33473ccfb5dd65f0eb65209baba30911" rel="noopener noreferrer"&gt;Insertion Sort GitHub Gist&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var arr = [10, 55, 20, 4, 28, 69, 22, 85, 7, 37];

function insertionSort(arr)
{
    for(let i = 1; i&amp;lt; arr.length; i++)
    {
        let key= arr[i];
        let j = i - 1

        while (j &amp;gt;= 0 &amp;amp;&amp;amp; key &amp;lt; arr[j]) {
            arr[j+1] = arr[j];
            j--;
        }
        arr[j+1] = key;
    }

    return arr;
}

console.log(insertionSort(arr));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Merge Sort
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Divides the array into halves, recursively sorts them, and then merges the sorted halves.&lt;br&gt;
&lt;strong&gt;Time Complexity:&lt;/strong&gt; O(n log n)&lt;br&gt;
&lt;strong&gt;Use Case:&lt;/strong&gt; Efficient for large datasets, uses additional space for merging.&lt;br&gt;
&lt;strong&gt;&lt;a href="https://gist.github.com/mshossain110/a6e2acad17995989fe1573a4aa779b0f" rel="noopener noreferrer"&gt;Merge Sort GitHub Gist&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;&lt;a href="https://gist.github.com/mshossain110/cabbf70a0bfe728226ea4ca6f5bb5b36" rel="noopener noreferrer"&gt;Merge Sort 2 GitHub Gist&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var unsortedArr = [10, 55, 20, 4, 28, 69, 22, 85, 7, 37];

function merge(left, right)
{
    const result = new Array();

    let i = j = 0;
    while (i &amp;lt; left.length &amp;amp;&amp;amp; j &amp;lt; right.length) {
        if (left[i] &amp;lt; right[j]){
            result.push(left[i]);
            i++;
        }else {
            result.push(right[j]);
            j++;
        }
    }

    while (i &amp;lt; left.length) {
        result.push(left[i]);
        i++;
    }

    while (j &amp;lt; right.length) {
        result.push(right[j]);
        j++;
    }

    return result;
}

function mergeSort(arr)
{
    if (arr.length &amp;lt;= 1)
        return arr;

    const mid = Math.floor(arr.length/2);
    const LA = new Array();
    const RA = new Array();

    for(let i = 0; i&amp;lt; mid; i++)
        LA.push(arr[i]);

    for(let j = mid; j&amp;lt; arr.length; j++)
        RA.push(arr[j]);


    const leftSorted = mergeSort(LA);
    const rightSorted = mergeSort(RA);

    return merge(leftSorted, rightSorted);
}

console.log(mergeSort(unsortedArr));

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Quick Sort
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Selects a pivot element and partitions the array into two sub-arrays: elements less than the pivot and elements greater than the pivot, then recursively sorts the sub-arrays. &lt;br&gt;
&lt;strong&gt;Time Complexity:&lt;/strong&gt; O(n log n) on average, O(n²) in the worst case.&lt;br&gt;
&lt;strong&gt;Use Case:&lt;/strong&gt; Fast and widely used for large datasets.&lt;br&gt;
&lt;strong&gt;&lt;a href="https://gist.github.com/mshossain110/85382486812b92718941e972abfd3365" rel="noopener noreferrer"&gt;Quick Sort GitHub Gist&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var arr = [10, 55, 20, 4, 28, 69, 22, 85, 7, 37];

function partition(arr, low, high)
{
    const pivot = arr[high];

    let i = low -1;

    for(let j = low; j &amp;lt;= high -1; j++)
    {
        if (arr[j] &amp;lt; pivot) {
            i++
            swap(arr, i, j)
        }
    }

    swap(arr, i+ 1, high);

    return i + 1
}

function swap(arr, i, j)
{
    let temp = arr[i];
    arr[i] = arr[j];
    arr[j] = temp;
}

function QuickSort(arr, low, high)
{
    if (low  &amp;lt; high){
        const po = partition(arr, low, high);
        QuickSort(arr, low, po - 1);
        QuickSort(arr, po + 1, high);
    }

    return arr;
}

console.log(QuickSort(arr, 0, arr.length - 1));

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Heap Sort
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Converts the array into a heap data structure and repeatedly extracts the maximum element to build the sorted array.&lt;br&gt;
&lt;strong&gt;Time Complexity:&lt;/strong&gt; O(n log n)&lt;br&gt;
&lt;strong&gt;Use Case:&lt;/strong&gt; Efficient and doesn't require extra space like merge sort.&lt;/p&gt;

&lt;h2&gt;
  
  
  Radix Sort
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Non-comparative sorting algorithm that sorts elements digit by digit, starting from the least significant digit to the most significant.&lt;br&gt;
&lt;strong&gt;Time Complexity:&lt;/strong&gt; O(nk) where k is the number of digits.&lt;br&gt;
&lt;strong&gt;Use Case:&lt;/strong&gt; Suitable for sorting numbers or strings with fixed-length keys.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bucket Sort
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Divides elements into several buckets and then sorts each bucket individually (usually using another sorting algorithm).&lt;br&gt;
&lt;strong&gt;Time Complexity:&lt;/strong&gt; O(n + k) where k is the number of buckets.&lt;br&gt;
&lt;strong&gt;Use Case:&lt;/strong&gt; Effective when input is uniformly distributed over a range.&lt;/p&gt;

&lt;p&gt;Each algorithm has its strengths and weaknesses, and the choice of which one to use depends on the size of the dataset, memory constraints, and whether the data is partially sorted.&lt;/p&gt;

&lt;p&gt;Let's discuss how often we should practice those.&lt;/p&gt;

</description>
      <category>sorting</category>
      <category>algorithms</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>3 major REST API problem can solve using GraphQL</title>
      <dc:creator>Shahadat Hossain</dc:creator>
      <pubDate>Tue, 16 Apr 2019 05:07:56 +0000</pubDate>
      <link>https://dev.to/mshossain110/3-major-rest-api-problem-can-solve-using-graphql-1dg2</link>
      <guid>https://dev.to/mshossain110/3-major-rest-api-problem-can-solve-using-graphql-1dg2</guid>
      <description>&lt;p&gt;Here I am not going to talk what is and how do GraphQL. I think, there are hundreds of articles about it. I want to share, what I understand in my learning and working time. if I am wrong please amend me.&lt;/p&gt;

&lt;p&gt;When Facebook building its mobile application in 2012 its faced some issues in their REST API which led them to create GraphQL. We are also facing those problems when we design the REST API. That is :&lt;br&gt;
    &lt;/p&gt;
&lt;ul&gt;

    &lt;li&gt;Poor performance&lt;/li&gt;

    &lt;li&gt; A lot of endpoints&lt;/li&gt;

    &lt;li&gt; Over-fetching or under-fetching of data&lt;/li&gt;

    &lt;li&gt; Difficulty understanding APIs&lt;/li&gt;

    &lt;li&gt; Difficulty API versioning&lt;/li&gt;

    &lt;/ul&gt;
&lt;br&gt;
With GraphQL, we get a lot of new features that give you superpowers when you are building your APIs.
&lt;h2&gt;
  
  
  Minimize data fetching
&lt;/h2&gt;

&lt;p&gt;Over-fetching or Under-fetching is a performance issue in REST API. Basic REST APIs always return a fixed structure of data. we should fetch the data that we need. Using GraphQL we can minimize data fetching and improve the performance of our REST API especially in case of slow network connection. &lt;/p&gt;

&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%2Fmshossain.me%2Fwp-content%2Fuploads%2F2019%2F04%2F1_odlr0di3IFkR9RxagoTL-g.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%2Fmshossain.me%2Fwp-content%2Fuploads%2F2019%2F04%2F1_odlr0di3IFkR9RxagoTL-g.png" alt="Graphql rest api"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There’s also a problem with under-fetching of information. To fetch relational data we need too many requests in the server or large object with unnecessary data. This damage not only our application performance but also catch space. In that case, GraphQL can help to solve the problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Minimize Application endpoint
&lt;/h2&gt;

&lt;p&gt;To fetch REST API data all of us use CRUD system. For each particular resource, there are GET, POST, PUT, DELETE, OPTION request methods to control data. So, in a real-world application, we would end up having a lot of endpoints for a lot of resources. It is hard to remember or control those endpoints. If you are dealing with large scale application like facebook or twitter, it is very difficult to maintaining those endpoints. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmshossain.me%2Fwp-content%2Fuploads%2F2019%2F04%2Fgraphql-request.jpg" 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%2Fmshossain.me%2Fwp-content%2Fuploads%2F2019%2F04%2Fgraphql-request.jpg" alt="GraphQL endpoint request"&gt;&lt;/a&gt;&lt;br&gt;
This biggest problem can solve using GraphQL. GraphQL has only one endpoint and just makes the whole server a single custom endpoint that can reply to all data questions. You just need type or mutation to control your resource. &lt;/p&gt;

&lt;h2&gt;
  
  
  Optimize API Versioning
&lt;/h2&gt;

&lt;p&gt;One of the biggest problem in general REST API is version controlling. In different reason and adding new features, we need to change backend API several times.  To keep unbreakable front-end and API users we need vertioning in our REST API. &lt;/p&gt;

&lt;p&gt;In GraphQL there’s no need for it since you are fetching your APIs by adding new types or removing old ones. Since are fetching, how much data we need, it will be unbreakable in most of the case. &lt;br&gt;
Also, there is an only one endpoint we do not need endpoint like &lt;/p&gt;

&lt;pre&gt;
https://api.example.com/v1/users/12312
https://api.example.com/v2/users/12312
&lt;/pre&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;GraphQL might seem complex at first because it’s a technology that reaches across many areas of modern development. But if you take the time to understand the underlying concepts, I think you’ll find out that a lot of it just makes sense.&lt;br&gt;
Agree? Disagree? Questions? Just let me know here in the comments. And if you’ve enjoyed this article, please consider and sharing it! Want to reach me just follow on &lt;a href="https://twitter.com/mshossain110" rel="noopener noreferrer"&gt;twitter&lt;/a&gt;&lt;/p&gt;

</description>
      <category>graphql</category>
      <category>restapi</category>
    </item>
    <item>
      <title>Designing Laravel REST API: Best practices</title>
      <dc:creator>Shahadat Hossain</dc:creator>
      <pubDate>Sun, 07 Apr 2019 19:15:49 +0000</pubDate>
      <link>https://dev.to/mshossain110/designing-laravel-rest-api-best-practices-3ilg</link>
      <guid>https://dev.to/mshossain110/designing-laravel-rest-api-best-practices-3ilg</guid>
      <description>

&lt;p&gt;In modern application, API is one of the main feature in the application. It’s not only for creating mobile applications, desktop applications but also important for self-hosted web applications.&lt;/p&gt;

&lt;p&gt;Now front-end and backend applications development has great changes using Vue or React front-end framework. All new applications want to single page application. That’s why implement API in the backend is the main feature.&lt;/p&gt;

&lt;p&gt;Basically, an API is an interface that returns data in a special format that any kind of application, either it’s an Android app or a web app, can understand.&lt;/p&gt;

&lt;p&gt;When developing an API, you need to take into considerations some best practices which follow different developer. I have research on web tutorials and sort out some best practices which I follow in my Laravel applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Best practices for developing Laravel rest API&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Coding standards
&lt;/h4&gt;

&lt;p&gt;It’s not only related to designing rest API, but it’s related to all kind of applications. Whenever I start building some application I start reading the coding standard of the application even I read it before. It’s forced me to follow the coding standard. Some of are related to designing rest API in Laravel.&lt;/p&gt;

&lt;h4&gt;
  
  
  Use routes/api.php file for API routes
&lt;/h4&gt;

&lt;p&gt;Laravel be default has a separate&lt;code&gt;routes/api.php&lt;/code&gt; file that defers from the usual &lt;code&gt;routes/web.php&lt;/code&gt; file. I think we must store our API routes in this file. It has an onboard applied middleware (which can be seen in&lt;code&gt;app/Http/Kernel.php&lt;/code&gt; the $middlewareGroups variable, under &lt;code&gt;api&lt;/code&gt;) and a prefix of&lt;code&gt;/api&lt;/code&gt; so all routes defined are already available to &lt;code&gt;/api&lt;/code&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  Route names with a api prefix
&lt;/h4&gt;

&lt;p&gt;What I like to do, is to set a group route an as setting to the whole API, so I can access the routes by their name, with &lt;code&gt;api&lt;/code&gt;. prefix.&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route::get('/users', "API\V1\UserController@index")-&amp;gt;name("users");
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This route’s URL can be get using &lt;code&gt;route('users')&lt;/code&gt; but it might conflict with &lt;code&gt;web.php&lt;/code&gt;.&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route::group(['as' =&amp;gt; 'api.'], function () {
  Route::get('/users', 'API\V1\UserController@index)-&amp;gt;name('users');
});
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This way, you will have it on &lt;code&gt;route('api.users')&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you use the route namings, if you write tests, you won’t need to replace the URL everywhere if you plan to change the URL location and keep the route name.&lt;/p&gt;

&lt;h4&gt;
  
  
  Use plurals to describe resources
&lt;/h4&gt;

&lt;p&gt;When you write resource route you should write plurals.&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Route::resource('/users', 'API\V1\UserController’)-&amp;gt;name('users');
// mysite.com/api/v1/customers
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  API Versioning
&lt;/h4&gt;

&lt;p&gt;Remember the API will be used by other programs. We occasionally update the code on the server but it will break the client’s applications. This is when API versioning comes in handy. If your API is not publicly accessible you can keep as default. Our above URL when versioning is considered will look as follows.&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mysite.com/api/v1/customers
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  Use Passport instead of JWT for API authentication
&lt;/h4&gt;

&lt;p&gt;I personally like the Passport for authentication. It’s reliable and has support for Laravel developer.&lt;/p&gt;

&lt;h4&gt;
  
  
  Use a transformer
&lt;/h4&gt;

&lt;p&gt;I always use a transformer to get data in one format. Although Laravel has own transformer class I personally like &lt;code&gt;league/fractal&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Response Codes and Error Handling
&lt;/h4&gt;

&lt;p&gt;HTTP status codes will simplify giving feedback to your API users. Also you have to give a server message with a response. To handle errors, transformer and keep similar data set I have write a controller that is responsible to handle errors.&lt;/p&gt;

&lt;h4&gt;
  
  
  Limit the number of request in a given time period from the same IP Address
&lt;/h4&gt;

&lt;p&gt;If it’s exposed to the public online then it is a target for spam, bots and abuse. You can limit to a request made per second to say maybe 5. Anything more than that may be an indicated of automated programs abusing your API.&lt;/p&gt;



&lt;div class="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="k"&gt;namespace&lt;/span&gt; &lt;span class="nx"&gt;App\Http\Controllers\Api\V1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nx"&gt;League\Fractal\Manager&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nx"&gt;League\Fractal\Resource\Item&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nx"&gt;App\Http\Controllers\Controller&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nx"&gt;League\Fractal\Resource\Collection&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nx"&gt;League\Fractal\Pagination\IlluminatePaginatorAdapter&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ApiController&lt;/span&gt; &lt;span class="k"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;Controller&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="sd"&gt;/**
     * @var int $statusCode
     */&lt;/span&gt;
    &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="nv"&gt;$statusCode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="no"&gt;CODE_WRONG_ARGS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'GEN-FUBARGS'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="no"&gt;CODE_NOT_FOUND&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'GEN-LIKETHEWIND'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="no"&gt;CODE_INTERNAL_ERROR&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'GEN-AAAGGH'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="no"&gt;CODE_UNAUTHORIZED&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'GEN-MAYBGTFO'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="no"&gt;CODE_FORBIDDEN&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'GEN-GTFO'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="no"&gt;CODE_INVALID_MIME_TYPE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'GEN-UMWUT'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="sd"&gt;/**
     * @var Manager $fractal
     */&lt;/span&gt;
    &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="nv"&gt;$fractal&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="nf"&gt;__construct&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;fractal&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Manager&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;isset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$_GET&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'include'&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;fractal&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;parseIncludes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$_GET&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'include'&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="sd"&gt;/**
     * Get the status code.
     *
     * @return int $statusCode
     */&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getStatusCode&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="sd"&gt;/**
     * Set the status code.
     *
     * @param $statusCode
     * @return $this
     */&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;setStatusCode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$statusCode&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;statusCode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$statusCode&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="sd"&gt;/**
     * Repond a no content response.
     * 
     * @return response
     */&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;noContent&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;204&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="sd"&gt;/**
     * Respond the item data.
     *
     * @param $item
     * @param $callback
     * @return mixed
     */&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;respondWithItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$item&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$callback&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Successfully'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$resource&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Item&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$item&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$callback&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="nv"&gt;$data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;fractal&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;createData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$resource&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;toArray&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

        &lt;span class="nv"&gt;$data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'message'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$message&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;respondWithArray&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="sd"&gt;/**
     * Respond the collection data.
     *
     * @param $collection
     * @param $callback
     * @return mixed
     */&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;respondWithCollection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$collection&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$callback&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Successfully'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$resource&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Collection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$collection&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$callback&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="nv"&gt;$data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;fractal&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;createData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$resource&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;toArray&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="nv"&gt;$data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'message'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$message&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;respondWithArray&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="sd"&gt;/**
     * Respond the collection data with pagination.
     *
     * @param $paginator
     * @param $callback
     * @return mixed
     */&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;respondWithPaginator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$paginator&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$callback&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Successfully'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$resource&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Collection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$paginator&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getCollection&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="nv"&gt;$callback&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="nv"&gt;$resource&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setPaginator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;IlluminatePaginatorAdapter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$paginator&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

        &lt;span class="nv"&gt;$data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;fractal&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;createData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$resource&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;toArray&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="nv"&gt;$data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'message'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$message&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;respondWithArray&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="sd"&gt;/**
     * Respond the data.
     *
     * @param array $array
     * @param array $headers
     * @return mixed
     */&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;respondWithArray&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;array&lt;/span&gt; &lt;span class="nv"&gt;$array&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt; &lt;span class="nv"&gt;$headers&lt;/span&gt; &lt;span class="o"&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;return&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$array&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$headers&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="sd"&gt;/**
     * Respond the message.
     * 
     * @param string $message
     * @return json
     */&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;respondWithMessage&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setStatusCode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;respondWithArray&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
                    &lt;span class="s1"&gt;'message'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$message&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="sd"&gt;/**
     * Respond the error message.
     * 
     * @param string $message
     * @param string $errorCode
     * @return json
     */&lt;/span&gt;
    &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;respondWithError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$errorCode&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt; &lt;span class="o"&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;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;statusCode&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nb"&gt;trigger_error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="s2"&gt;"You better have a really good reason for erroring on a 200..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="nx"&gt;E_USER_WARNING&lt;/span&gt;
            &lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;respondWithArray&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
            &lt;span class="s1"&gt;'errors'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s1"&gt;'code'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$errorCode&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s1"&gt;'message'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$message&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="sd"&gt;/**
     * Respond the error of 'Forbidden'
     * 
     * @param string $message
     * @return json
     */&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;errorForbidden&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Forbidden'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt; &lt;span class="o"&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;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setStatusCode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;respondWithError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;self&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;CODE_FORBIDDEN&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="sd"&gt;/**
     * Respond the error of 'Internal Error'.
     * 
     * @param string $message
     * @return json
     */&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;errorInternalError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Internal Error'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt; &lt;span class="o"&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;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setStatusCode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;respondWithError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;self&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;CODE_INTERNAL_ERROR&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="sd"&gt;/**
     * Respond the error of 'Resource Not Found'
     * 
     * @param string $message
     * @return json
     */&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;errorNotFound&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Resource Not Found'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt; &lt;span class="o"&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;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setStatusCode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;404&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;respondWithError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;self&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;CODE_NOT_FOUND&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="sd"&gt;/**
     * Respond the error of 'Unauthorized'.
     * 
     * @param string $message
     * @return json
     */&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;errorUnauthorized&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Unauthorized'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt; &lt;span class="o"&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;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setStatusCode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;401&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;respondWithError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;self&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;CODE_UNAUTHORIZED&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="sd"&gt;/**
     * Respond the error of 'Wrong Arguments'.
     * 
     * @param string $message
     * @return json
     */&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;errorWrongArgs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Wrong Arguments'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$errors&lt;/span&gt; &lt;span class="o"&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;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;setStatusCode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;respondWithError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;self&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;CODE_WRONG_ARGS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$errors&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;h4&gt;
  
  
  Security
&lt;/h4&gt;

&lt;p&gt;The biggest problem you should be take care of is security. Laravel application is easy to secure it, but if not doing it properly, you might get hacked. In Laravel, you might want to use Laravel Passport — it belongs to the Laravel ecosystem, supports authentication through that App ID — App Secret thingy in order to get an access token, either to impersonate somebody or a server, either it’s backend or frontend.&lt;/p&gt;

&lt;h4&gt;
  
  
  Too hard to understand? Reach me!
&lt;/h4&gt;

&lt;p&gt;If you have more questions about Laravel, if you need help with any information related to Laravel you can get in touch.&lt;/p&gt;

&lt;h4&gt;
  
  
  Say Thank you.
&lt;/h4&gt;

&lt;p&gt;If any mistake please mention in the comment. If you like it you can encourage me saying Thank you.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://mshossain.me/blog/designing-laravel-rest-api-best-practices/"&gt;Designing Laravel REST API: Best practices&lt;/a&gt; appeared first on &lt;a href="https://mshossain.me"&gt;Shahadat Hossain&lt;/a&gt;.&lt;/p&gt;


</description>
      <category>laravel</category>
      <category>bestpractices</category>
      <category>php</category>
    </item>
    <item>
      <title>How I structured my Vue project for scaling large Vue.js application</title>
      <dc:creator>Shahadat Hossain</dc:creator>
      <pubDate>Tue, 02 Apr 2019 21:53:06 +0000</pubDate>
      <link>https://dev.to/mshossain110/how-i-structured-my-vue-project-for-scaling-large-vue-js-application-n9o</link>
      <guid>https://dev.to/mshossain110/how-i-structured-my-vue-project-for-scaling-large-vue-js-application-n9o</guid>
      <description>&lt;p&gt;Vue.js is great. However, when you start building large scale Vue applications, you will find some architectural issues in your application. These issues are not really the limitations of the framework; rather these are the important design decisions that Vue.js team had taken from time to time.&lt;/p&gt;

&lt;p&gt;Unlike React or Angular, Vue.js caters to the different level of developers. It is developers friendly, easy-to-use for beginners and equally flexible for experts. It doesn’t try to shy away from DOM. Instead, it plays well with it.&lt;/p&gt;

&lt;p&gt;Unlike React or Angular, Vue.js caters to the different level of developers. It is developers friendly, easy-to-use for beginners and equally flexible for experts. It doesn’t try to shy away from DOM. Instead, it plays well with it.&lt;/p&gt;

&lt;p&gt;Like other developers, first, you have to consider exactly what are your needs when building a large scale application. So I will share my own experience building a large app with vue, vuex, vue-router as front-end application.&lt;/p&gt;

&lt;h3&gt;
  
  
  The difficulties of building a large scale application
&lt;/h3&gt;

&lt;p&gt;I face some of the difficulties when I working on a large scale application. we should Be prepared to&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Review the behavior, the architecture, the code base and the look of the front-end several times, which takes a long time.&lt;/li&gt;
&lt;li&gt;Change several times as long as the change in the backend the ways to access the data.&lt;/li&gt;
&lt;li&gt;Manage code from different developers with diametrically opposed ways of thinking.&lt;/li&gt;
&lt;li&gt;Rewrite codes to the developers that you do not like within your guideline.&lt;/li&gt;
&lt;li&gt;Spend a lot, but a LOT of time writing and debugging tests.&lt;/li&gt;
&lt;li&gt;Give question answer for the developers and manager where you have written the codes.&lt;/li&gt;
&lt;li&gt;The estimates you make on new features ALWAYS magically transform to deadlines, with big events if they are outdated.&lt;/li&gt;
&lt;li&gt;Be very very flexible in all those things you need to be ready for.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Component Modularisation
&lt;/h3&gt;

&lt;p&gt;A component as a build tool not only deals with JavaScript; it can also build CSS, templates and other assets. With builder hooks, it can also pre-process files written in non-native formats, e.g. CoffeeScript, SASS and Stylus. Therefore it is possible to deliver highly self-contained components that encapsulate template structure, JavaScript logic and CSS presentation at the same time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Vue js default folder structure
&lt;/h3&gt;

&lt;p&gt;I recommend you to start the project with &lt;code&gt;vue-cli&lt;/code&gt;. I personally like the default Webpack template provided. Here is the content of the src folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.
├── app.css
├── App.vue
├── assets
│ └── ...
├── components
│ └── ...
├── main.js
├── mixins
│ └── ...
├── router
│ └── index.js
├── store
│ ├── index.js
│ ├── modules
│ │ └── ...
│ └── mutation-types.js
├── translations
│ └── index.js
├── utils
│ └── ...
└── views
   └── ...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Modularisation of Vue component
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;Vue-cli&lt;/code&gt; provided a great file architecture. But growing your project, your files will start to become overweight.&lt;/p&gt;

&lt;p&gt;You might be tempted to put separate your components into multiple folders. But, again, after 10 pages, you will face the same issue again.&lt;/p&gt;

&lt;p&gt;The idea is to split your application by notions. Stick to one unique word.&lt;/p&gt;

&lt;p&gt;For example, in a shop application, we could get Catalog, Basket and Payment. Now&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;├─ src/
│ ├─ components/
│ │ ├─ Catalog/
│ │ │ ├─ Components/
│ │ │ ├─ Pages/
│ │ │ ├─ Routes/ Or router.js
│ │ │ ├─ mixin/
│ │ │ │ ├─ catalog.api.js
│ │ │ │ └─ catalog.services.js
│ │ │ ├─ Store/
│ │ │ │ ├─ action.js
│ │ │ │ └─ getters.js
│ │ │ │ └─ mutationTypes.js
│ │ │ │ └─state.js
│ │ │ │ └─ index.js
│ │ │ ├─ Tests/
│ │ │ ├─ Catalog.vue
│ │ │ ├─ index.js
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Module A&lt;/code&gt; shouldn’t share a component with &lt;code&gt;Module B&lt;/code&gt;. For common functionalities (i.e. user logged in, user language…), I have the core folder!&lt;/p&gt;

&lt;h4&gt;
  
  
  Smart vs. Dumb components
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;smart components: can access the store, router, window object…&lt;/li&gt;
&lt;li&gt;dumbs components: take props, emits events. That’s it!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is important to keep a separation between your smart components(Pages folder) from the dumbs (Components folder). The main benefits of this approach are reusability, a better separation of concerns.&lt;/p&gt;

&lt;h3&gt;
  
  
  Testing
&lt;/h3&gt;

&lt;p&gt;Testing application is a very complex topic. It is the hardest part too. By this architecture, I can keep simple and clean. The things I test for the application.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Components: High priority, easy to do. write unit tests for each component. it should be easy to do.&lt;/li&gt;
&lt;li&gt;Pages: High priority, hard to do. You probably gonna have to mock API/browser parts.&lt;/li&gt;
&lt;li&gt;Routes: Usually bugs aren’t here. Leave it for E2E tests.&lt;/li&gt;
&lt;li&gt;Mixins: API Part I personally don’t test this part. But others functions I test it. &lt;/li&gt;
&lt;li&gt;Store: The hardest part to test. You can test it via integration tests. Testing action, getter, and initial state separately are useless.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Modularisation of the vuex store
&lt;/h3&gt;

&lt;p&gt;Vuex store, One of the biggest problems with a component-based application. This is a really great tool for state management. The first time I start using the Vue tools, it completely change my mind. But we can’t use it everywhere. With the growing your application the problem arises.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ime travel impossible with lots of mutations when a page load.&lt;/li&gt;
&lt;li&gt;The state isn’t reinitialized when page switched. We need to update the state every time;&lt;/li&gt;
&lt;li&gt;Overkilled features. You need to create a mutation for everything.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using module in Vuex store is really great. For beginner user or small projects, you can store data in a file. With growing your project you should separate state, getters, mutations, and actions in different files, which is a good thing. It also presents modules, but without true guidelines to manage them. there’s a lot of ways to handle complexity, each one with pros and cons.&lt;/p&gt;

&lt;p&gt;By organizing your store like you gain several advantages :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For more readable and maintainable Having one file per data model is good.&lt;/li&gt;
&lt;li&gt;With backend update, you don’t need to change every file.&lt;/li&gt;
&lt;li&gt;You can have a consistent getters and methods naming model across different data models.&lt;/li&gt;
&lt;li&gt;Don’t overuse the store, you have a complete view where you need to use it or not.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  When should I use the store or not?
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;It’s not mandatory, nor recommended putting all your state inside a Vuex store.&lt;/p&gt;

&lt;p&gt;&lt;cite&gt;&lt;strong&gt; &lt;a href="https://github.com/vuejs/vuex/issues/236#issuecomment-231754241"&gt;Evan You (creator of Vue.js)&lt;/a&gt;&lt;/strong&gt;&lt;/cite&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;data must be accessible in multiple components of your application, by components which oftentimes are not related in any way, they neither are parents or children of each other.&lt;/li&gt;
&lt;li&gt;Data frequently update from different components.&lt;/li&gt;
&lt;li&gt;When data complexity is higher to manage it and event passing is not possible&lt;/li&gt;
&lt;li&gt;when you need to communicate or pass data between sibling components, or if a data change in one component (such as a boolean change) triggers a change in another &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I recommend you to use the local component state as your default and only opt-in to Vuex as soon as a reason to do so arises&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://mshossain.me/blog/structured-my-vue-project-for-scaling-large-vue-js-application/"&gt;How I structured my Vue project for scaling large Vue.js application&lt;/a&gt; appeared first on &lt;a href="https://mshossain.me"&gt;Shahadat Hossain&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>vue</category>
      <category>structure</category>
    </item>
  </channel>
</rss>
