<?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: Iqbal Syahrul Siddiq</title>
    <description>The latest articles on DEV Community by Iqbal Syahrul Siddiq (@iqbalsyahrulsiddiq).</description>
    <link>https://dev.to/iqbalsyahrulsiddiq</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%2F1142450%2F4ad395d4-c90d-40ff-acf8-aa20ff6b5cfb.jpeg</url>
      <title>DEV Community: Iqbal Syahrul Siddiq</title>
      <link>https://dev.to/iqbalsyahrulsiddiq</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/iqbalsyahrulsiddiq"/>
    <language>en</language>
    <item>
      <title>What you can do when a project is stuck ?</title>
      <dc:creator>Iqbal Syahrul Siddiq</dc:creator>
      <pubDate>Wed, 20 Sep 2023 14:33:12 +0000</pubDate>
      <link>https://dev.to/iqbalsyahrulsiddiq/what-you-can-do-when-project-stuck--1gnc</link>
      <guid>https://dev.to/iqbalsyahrulsiddiq/what-you-can-do-when-project-stuck--1gnc</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8vGxeNak--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/khnqvqoryq3patdnjyg8.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8vGxeNak--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/khnqvqoryq3patdnjyg8.jpeg" alt="Image description" width="800" height="401"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We’ve all seen projects that are stuck at a particular stage, failing to progress or move forward. Maybe the team can't seem to get decisions, has 'paralysis by analysis' of options, the business case can't get past gateways, or there are unresolved issues between stakeholders or teams holding up critical delivery actions.&lt;/p&gt;

&lt;p&gt;The initiative might be a fabulous idea conceptually, but you just don't seem to be able to get traction to move it along.&lt;/p&gt;

&lt;p&gt;Therefore, a stuck project is like a “Nightmare” for any Project Manager and the Organization. If you are feeling “stuck” on a project and are having a hard time figuring out your next step, try the solutions listed below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Take a break.&lt;/strong&gt;&lt;/em&gt; Sometimes the best way to get unstuck is to simply step away from the project for a while. Go for a walk, listen to music, or do something else that you enjoy. When you come back to the project, you may be able to approach it with fresh eyes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Break the project down into smaller tasks.&lt;/strong&gt;&lt;/em&gt; If the project is overwhelming, try breaking it down into smaller, more manageable tasks. This will make it seem less daunting and help you to make progress.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Talk to someone.&lt;/em&gt;&lt;/strong&gt; If you're still stuck, talking to someone else can be helpful. This could be a colleague, manager, friend, or family member. Sometimes just talking about the problem can help you to see it from a different perspective and come up with a solution.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Do some research.&lt;/strong&gt;&lt;/em&gt; If you're stuck on a particular aspect of the project, try doing some research to see if you can find a solution. There are many resources available online and in libraries.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Ask for help.&lt;/strong&gt;&lt;/em&gt; If you've tried all of the above and you're still stuck, don't be afraid to ask for help. This could be from a colleague, manager, or someone else with expertise in the area you're working on.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Believe in yourself, everything is gonna be fine&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Waterfall vs Agile, Which is best methodologies for Software Project Management ?</title>
      <dc:creator>Iqbal Syahrul Siddiq</dc:creator>
      <pubDate>Sat, 16 Sep 2023 03:56:25 +0000</pubDate>
      <link>https://dev.to/iqbalsyahrulsiddiq/waterfall-vs-agile-which-is-best-methodologies-for-software-project-management--2a3c</link>
      <guid>https://dev.to/iqbalsyahrulsiddiq/waterfall-vs-agile-which-is-best-methodologies-for-software-project-management--2a3c</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7whMUw1t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tlfjy6hv95g19v8lg8wx.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7whMUw1t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tlfjy6hv95g19v8lg8wx.jpeg" alt="Image description" width="512" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A methodology is a set of principles, practices, and techniques that are used to achieve a specific goal. Methodologies can be used in a variety of fields, including business, science, and education.&lt;/p&gt;

&lt;p&gt;In project management, methodologies are used to plan, execute, and control projects. There are many different methodologies that can be used, each with its own strengths and weaknesses. Some of the most common methodologies include:&lt;/p&gt;

&lt;h2&gt;
  
  
  Waterfall
&lt;/h2&gt;

&lt;p&gt;Waterfall methodology is a linear approach to project management. Each phase of the project must be completed before the next phase can begin. The waterfall methodology is often used for large and complex projects, such as building a new bridge or developing a new software system.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6Jbg8uD0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j1tejdygu5j012otb5q4.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6Jbg8uD0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j1tejdygu5j012otb5q4.jpeg" alt="Image description" width="720" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The waterfall methodology consists of the following phases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Requirements gathering: The project team identifies the needs of the project stakeholders and documents the requirements of the project.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Design: The project team designs the solution to meet the project requirements.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Implementation: The project team develops and builds the solution.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Testing: The project team tests the solution to ensure that it meets the project requirements.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deployment: The project team deploys the solution to production.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The waterfall methodology has a number of advantages, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is a structured approach to project management.&lt;/li&gt;
&lt;li&gt;It is easy to follow and understand.&lt;/li&gt;
&lt;li&gt;It is well-suited for large and complex projects.&lt;/li&gt;
&lt;li&gt;It provides a clear roadmap for the project team to follow&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, the waterfall methodology also has a number of disadvantages, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is not flexible. Changes to the project requirements can be difficult and expensive to implement.&lt;/li&gt;
&lt;li&gt;It can be slow and time-consuming. It can take a long time to complete each phase of the project before moving on to the next phase.&lt;/li&gt;
&lt;li&gt;It can lead to rework. If the project team discovers errors in the design or implementation of the solution, they may have to go back and rework earlier phases of the project.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Overall, the waterfall methodology is a good choice for large and complex projects where there is a need for a structured and well-defined approach. However, it is important to be aware of the disadvantages of the waterfall methodology before using it.&lt;/p&gt;

&lt;p&gt;Here are some tips for using the waterfall methodology effectively:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Start with a clear and well-defined set of requirements. This will help to ensure that the project team is working towards the same goals.&lt;/li&gt;
&lt;li&gt;Use a detailed project plan. The project plan should document the tasks that need to be completed, the resources that are needed, and the timeline for completing each task.&lt;/li&gt;
&lt;li&gt;Communicate regularly with the project stakeholders. This will help to keep the stakeholders informed of the project's progress and to get their feedback.&lt;/li&gt;
&lt;li&gt;Be flexible. Changes to the project requirements are inevitable. Be prepared to adapt the project plan accordingly.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Agile
&lt;/h2&gt;

&lt;p&gt;Agile methodologies are iterative approaches to project management. The project is broken down into small increments, and each increment is developed and delivered to the customer for feedback. Agile methodologies are often used for smaller and more complex projects, such as developing new software products or websites.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--I16l_YUv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1x1mgdu2zntlpi56h85i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I16l_YUv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1x1mgdu2zntlpi56h85i.png" alt="Image description" width="800" height="394"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are many different agile methodologies, but they all share some common characteristics. These characteristics include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Emphasis on collaboration: Agile methodologies emphasize collaboration between the project team and the customer. This collaboration helps to ensure that the project meets the customer's needs.&lt;/li&gt;
&lt;li&gt;Flexibility: Agile methodologies are flexible and adaptable. This allows the project team to respond to changes in the customer's needs or to unexpected challenges.&lt;/li&gt;
&lt;li&gt;Iteration: Agile methodologies use iterations to develop and deliver the project. This allows the project team to get feedback from the customer early and often, and to make necessary changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some of the most popular agile methodologies include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scrum: Scrum is a lightweight agile methodology that is often used for software development projects. Scrum teams work in short cycles called sprints, and each sprint produces a working product increment.&lt;/li&gt;
&lt;li&gt;Kanban: Kanban is a visual agile methodology that is often used for continuous improvement projects. Kanban boards are used to track the progress of work items, and the team focuses on delivering work items as quickly as possible.&lt;/li&gt;
&lt;li&gt;Extreme Programming (XP): XP is an agile methodology that focuses on simplicity, communication, feedback, courage, and respect. XP teams use short iterations, pair programming, and continuous integration to deliver high-quality software.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Agile methodologies have a number of advantages, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;They are flexible and adaptable. This allows the project team to respond to changes in the customer's needs or to unexpected challenges.&lt;/li&gt;
&lt;li&gt;They produce working software early and often. This allows the customer to get feedback on the product and to make necessary changes early in the development process.&lt;/li&gt;
&lt;li&gt;They promote collaboration between the project team and the customer. This helps to ensure that the project meets the customer's needs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, agile methodologies also have some disadvantages, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;They can be complex to implement. Agile methodologies require a high level of collaboration and communication between the project team and the customer.&lt;/li&gt;
&lt;li&gt;They can be difficult to manage. Agile methodologies require a lot of discipline and self-management from the project team.&lt;/li&gt;
&lt;li&gt;They can lead to rework. If the project team discovers errors in the product early on, they may have to go back and rework earlier iterations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Overall, agile methodologies are a good choice for smaller and more complex projects where there is a need for flexibility and adaptability. However, it is important to be aware of the disadvantages of agile methodologies before using them.&lt;/p&gt;

&lt;p&gt;Here are some tips for using agile methodologies effectively:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Start with a clear and well-defined set of goals. This will help to ensure that the project team is working towards the same goals.&lt;/li&gt;
&lt;li&gt;Communicate regularly with the customer. This will help to keep the customer informed of the project's progress and to get their feedback.&lt;/li&gt;
&lt;li&gt;Be flexible and adaptable. Changes to the customer's needs or to the project plan are inevitable. Be prepared to adapt accordingly.&lt;/li&gt;
&lt;li&gt;Use a variety of agile tools and techniques. There are many different agile tools and techniques available. Use the tools and techniques that work best for your team and your project.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Waterfall vs Agile
&lt;/h2&gt;

&lt;p&gt;The triple constraints is a project management concept that states that there are three constraints that must be balanced in order to successfully complete a project: time, cost, and scope.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IWWKqwXs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7tjvui0c80ktq5mfqoz2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IWWKqwXs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7tjvui0c80ktq5mfqoz2.png" alt="Image description" width="800" height="350"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Time: The amount of time available to complete the project.&lt;/li&gt;
&lt;li&gt;Cost: The amount of money available to spend on the project.&lt;/li&gt;
&lt;li&gt;Scope: The features and functionality of the project's deliverables.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the waterfall method, the triple constraints are typically managed by carefully planning and documenting the project at the beginning of the project. The project plan should specify the time, cost, and scope of the project, and it should be used to track progress and make adjustments as needed.&lt;/p&gt;

&lt;p&gt;In the agile method, the triple constraints are typically managed by iterative development and continuous feedback. The project is broken down into small, manageable increments, and each increment is developed and delivered to the customer for feedback. This allows the team to adjust the scope of the project as needed, and it also helps to ensure that the project stays on time and within budget.&lt;/p&gt;

&lt;p&gt;The triple constraints are a fundamental concept in project management, and they are important to consider regardless of the project management methodology that is being used. By carefully managing the triple constraints, project managers can increase the chances of successfully completing their projects.&lt;/p&gt;

&lt;p&gt;Here are some additional things to consider when applying the triple constraints to waterfall and agile projects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Waterfall projects: In waterfall projects, the triple constraints are typically managed by carefully planning and documenting the project at the beginning of the project. The project plan should specify the time, cost, and scope of the project, and it should be used to track progress and make adjustments as needed. However, it is important to be flexible in waterfall projects, as changes are inevitable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Agile projects: In agile projects, the triple constraints are typically managed by iterative development and continuous feedback. The project is broken down into small, manageable increments, and each increment is developed and delivered to the customer for feedback. This allows the team to adjust the scope of the project as needed, and it also helps to ensure that the project stays on time and within budget. However, it is important to be mindful of the overall scope of the project, as too many changes can make it difficult to deliver the final product.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Ultimately, the best way to apply the triple constraints to a project will depend on the specific project and the team's preferences. However, by understanding the triple constraints and how they can be managed, project managers can increase the chances of successfully completing their projects.&lt;/p&gt;

</description>
      <category>waterfall</category>
      <category>agile</category>
      <category>softwaredevelopment</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to make QR Scanner using Laravel &amp; Javascript</title>
      <dc:creator>Iqbal Syahrul Siddiq</dc:creator>
      <pubDate>Mon, 28 Aug 2023 08:45:27 +0000</pubDate>
      <link>https://dev.to/iqbalsyahrulsiddiq/how-to-make-qr-scanner-using-laravel-javascript-5360</link>
      <guid>https://dev.to/iqbalsyahrulsiddiq/how-to-make-qr-scanner-using-laravel-javascript-5360</guid>
      <description>&lt;p&gt;A QR Scanner is a device or software that can read and decode QR codes. QR codes are two-dimensional barcodes that can store a variety of information, such as text, URLs, contact information, and more.&lt;/p&gt;

&lt;p&gt;QR code scanners can be used to scan QR codes in a variety of ways. For example, they can be used to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open a website in a web browser&lt;/li&gt;
&lt;li&gt;Add a contact to a phone book&lt;/li&gt;
&lt;li&gt;Pay for goods or services&lt;/li&gt;
&lt;li&gt;Access loyalty programs&lt;/li&gt;
&lt;li&gt;Log in to websites or applications&lt;/li&gt;
&lt;li&gt;Share files&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;QR code scanners are available in a variety of forms, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mobile phone apps&lt;/li&gt;
&lt;li&gt;Point-of-sale (POS) devices&lt;/li&gt;
&lt;li&gt;Wearable devices&lt;/li&gt;
&lt;li&gt;Industrial scanners&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;QR code scanners are a convenient and efficient way to access information and perform tasks. They are becoming increasingly popular as QR codes become more widely used.&lt;/p&gt;

&lt;p&gt;Here are some of the benefits of using a QR code scanner:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Convenient: QR code scanners can be used to scan QR codes quickly and easily.&lt;/li&gt;
&lt;li&gt;Efficient: QR code scanners can save time and effort by eliminating the need to manually enter information.&lt;/li&gt;
&lt;li&gt;Secure: QR codes can be encrypted to protect the information they contain.&lt;/li&gt;
&lt;li&gt;Flexible: QR codes can be used to store a variety of information, making them versatile and adaptable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you are looking for a convenient and efficient way to access information and perform tasks, a QR code scanner is a good option to consider.&lt;/p&gt;

&lt;p&gt;In this tutorial i will show you how to make QR Scanner web based using Laravel &amp;amp; Javascript, it's easy and simple. We will using Javascript code from JSQRScanner Github (&lt;a href="https://github.com/jbialobr/JsQRScanner"&gt;https://github.com/jbialobr/JsQRScanner&lt;/a&gt;), and combine with Laravel.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install new laravel project (in this tutorial we will using Laravel version 8)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer create-project laravel/laravel:^8.0 example-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Download all javascript files from &lt;a href="https://github.com/jbialobr/JsQRScanner"&gt;https://github.com/jbialobr/JsQRScanner&lt;/a&gt; (Actually we don't need all folder, we just using JsQRScanner/docs/* . Copy all javascript folder in public folder&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kllXVcBQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ft7k3zmm4urn3rdg83f1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kllXVcBQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ft7k3zmm4urn3rdg83f1.png" alt="Image description" width="744" height="838"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open resources/views/welcome.blade.php, and modify code like bellow
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="{{ str_replace('_', '-', app()-&amp;gt;getLocale()) }}"&amp;gt;
    &amp;lt;head&amp;gt;
        &amp;lt;meta charset="utf-8"&amp;gt;
        &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1"&amp;gt;
        &amp;lt;title&amp;gt;Laravel QR Scan Using Webcam&amp;lt;/title&amp;gt;
        &amp;lt;!-- Fonts --&amp;gt;
        &amp;lt;link href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&amp;amp;display=swap" rel="stylesheet"&amp;gt;
        &amp;lt;!-- This script loads your compiled module.   --&amp;gt;
        &amp;lt;script type="text/javascript" src="{{ url('JS_Plugin/docs/jsPretty/jsqrscanner.nocache.js') }}"&amp;gt;&amp;lt;/script&amp;gt;

        &amp;lt;!-- Styles --&amp;gt;
        &amp;lt;style&amp;gt;
            /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}a{background-color:transparent}[hidden]{display:none}html{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}*,:after,:before{box-sizing:border-box;border:0 solid #e2e8f0}a{color:inherit;text-decoration:inherit}svg,video{display:block;vertical-align:middle}video{max-width:100%;height:auto}.bg-white{--bg-opacity:1;background-color:#fff;background-color:rgba(255,255,255,var(--bg-opacity))}.bg-gray-100{--bg-opacity:1;background-color:#f7fafc;background-color:rgba(247,250,252,var(--bg-opacity))}.border-gray-200{--border-opacity:1;border-color:#edf2f7;border-color:rgba(237,242,247,var(--border-opacity))}.border-t{border-top-width:1px}.flex{display:flex}.grid{display:grid}.hidden{display:none}.items-center{align-items:center}.justify-center{justify-content:center}.font-semibold{font-weight:600}.h-5{height:1.25rem}.h-8{height:2rem}.h-16{height:4rem}.text-sm{font-size:.875rem}.text-lg{font-size:1.125rem}.leading-7{line-height:1.75rem}.mx-auto{margin-left:auto;margin-right:auto}.ml-1{margin-left:.25rem}.mt-2{margin-top:.5rem}.mr-2{margin-right:.5rem}.ml-2{margin-left:.5rem}.mt-4{margin-top:1rem}.ml-4{margin-left:1rem}.mt-8{margin-top:2rem}.ml-12{margin-left:3rem}.-mt-px{margin-top:-1px}.max-w-6xl{max-width:72rem}.min-h-screen{min-height:100vh}.overflow-hidden{overflow:hidden}.p-6{padding:1.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.pt-8{padding-top:2rem}.fixed{position:fixed}.relative{position:relative}.top-0{top:0}.right-0{right:0}.shadow{box-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px 0 rgba(0,0,0,.06)}.text-center{text-align:center}.text-gray-200{--text-opacity:1;color:#edf2f7;color:rgba(237,242,247,var(--text-opacity))}.text-gray-300{--text-opacity:1;color:#e2e8f0;color:rgba(226,232,240,var(--text-opacity))}.text-gray-400{--text-opacity:1;color:#cbd5e0;color:rgba(203,213,224,var(--text-opacity))}.text-gray-500{--text-opacity:1;color:#a0aec0;color:rgba(160,174,192,var(--text-opacity))}.text-gray-600{--text-opacity:1;color:#718096;color:rgba(113,128,150,var(--text-opacity))}.text-gray-700{--text-opacity:1;color:#4a5568;color:rgba(74,85,104,var(--text-opacity))}.text-gray-900{--text-opacity:1;color:#1a202c;color:rgba(26,32,44,var(--text-opacity))}.underline{text-decoration:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.w-5{width:1.25rem}.w-8{width:2rem}.w-auto{width:auto}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}@media (min-width:640px){.sm\:rounded-lg{border-radius:.5rem}.sm\:block{display:block}.sm\:items-center{align-items:center}.sm\:justify-start{justify-content:flex-start}.sm\:justify-between{justify-content:space-between}.sm\:h-20{height:5rem}.sm\:ml-0{margin-left:0}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:pt-0{padding-top:0}.sm\:text-left{text-align:left}.sm\:text-right{text-align:right}}@media (min-width:768px){.md\:border-t-0{border-top-width:0}.md\:border-l{border-left-width:1px}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:1024px){.lg\:px-8{padding-left:2rem;padding-right:2rem}}@media (prefers-color-scheme:dark){.dark\:bg-gray-800{--bg-opacity:1;background-color:#2d3748;background-color:rgba(45,55,72,var(--bg-opacity))}.dark\:bg-gray-900{--bg-opacity:1;background-color:#1a202c;background-color:rgba(26,32,44,var(--bg-opacity))}.dark\:border-gray-700{--border-opacity:1;border-color:#4a5568;border-color:rgba(74,85,104,var(--border-opacity))}.dark\:text-white{--text-opacity:1;color:#fff;color:rgba(255,255,255,var(--text-opacity))}.dark\:text-gray-400{--text-opacity:1;color:#cbd5e0;color:rgba(203,213,224,var(--text-opacity))}.dark\:text-gray-500{--tw-text-opacity:1;color:#6b7280;color:rgba(107,114,128,var(--tw-text-opacity))}}
        &amp;lt;/style&amp;gt;

        &amp;lt;style&amp;gt;
            body {
                font-family: 'Nunito', sans-serif;
            }
        &amp;lt;/style&amp;gt;
    &amp;lt;/head&amp;gt;
    &amp;lt;script&amp;gt; 
    if (location.protocol != 'https:') { 
      document.getElementById('secure-connection-message').style='display: block';
      }
      &amp;lt;/script&amp;gt;  
    &amp;lt;body class="antialiased"&amp;gt;
        &amp;lt;div class="relative flex items-top justify-center min-h-screen bg-gray-100 dark:bg-gray-900 sm:items-center py-4 sm:pt-0"&amp;gt;
            &amp;lt;div class="max-w-6xl mx-auto sm:px-6 lg:px-8"&amp;gt;
                &amp;lt;div class="flex justify-center pt-8 sm:justify-start sm:pt-0"&amp;gt;
                    &amp;lt;svg viewBox="0 0 651 192" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-16 w-auto text-gray-700 sm:h-20"&amp;gt;
                        &amp;lt;g clip-path="url(#clip0)" fill="#EF3B2D"&amp;gt;
                            &amp;lt;path d="M248.032 44.676h-16.466v100.23h47.394v-14.748h-30.928V44.676zM337.091 87.202c-2.101-3.341-5.083-5.965-8.949-7.875-3.865-1.909-7.756-2.864-11.669-2.864-5.062 0-9.69.931-13.89 2.792-4.201 1.861-7.804 4.417-10.811 7.661-3.007 3.246-5.347 6.993-7.016 11.239-1.672 4.249-2.506 8.713-2.506 13.389 0 4.774.834 9.26 2.506 13.459 1.669 4.202 4.009 7.925 7.016 11.169 3.007 3.246 6.609 5.799 10.811 7.66 4.199 1.861 8.828 2.792 13.89 2.792 3.913 0 7.804-.955 11.669-2.863 3.866-1.908 6.849-4.533 8.949-7.875v9.021h15.607V78.182h-15.607v9.02zm-1.431 32.503c-.955 2.578-2.291 4.821-4.009 6.73-1.719 1.91-3.795 3.437-6.229 4.582-2.435 1.146-5.133 1.718-8.091 1.718-2.96 0-5.633-.572-8.019-1.718-2.387-1.146-4.438-2.672-6.156-4.582-1.719-1.909-3.032-4.152-3.938-6.73-.909-2.577-1.36-5.298-1.36-8.161 0-2.864.451-5.585 1.36-8.162.905-2.577 2.219-4.819 3.938-6.729 1.718-1.908 3.77-3.437 6.156-4.582 2.386-1.146 5.059-1.718 8.019-1.718 2.958 0 5.656.572 8.091 1.718 2.434 1.146 4.51 2.674 6.229 4.582 1.718 1.91 3.054 4.152 4.009 6.729.953 2.577 1.432 5.298 1.432 8.162-.001 2.863-.479 5.584-1.432 8.161zM463.954 87.202c-2.101-3.341-5.083-5.965-8.949-7.875-3.865-1.909-7.756-2.864-11.669-2.864-5.062 0-9.69.931-13.89 2.792-4.201 1.861-7.804 4.417-10.811 7.661-3.007 3.246-5.347 6.993-7.016 11.239-1.672 4.249-2.506 8.713-2.506 13.389 0 4.774.834 9.26 2.506 13.459 1.669 4.202 4.009 7.925 7.016 11.169 3.007 3.246 6.609 5.799 10.811 7.66 4.199 1.861 8.828 2.792 13.89 2.792 3.913 0 7.804-.955 11.669-2.863 3.866-1.908 6.849-4.533 8.949-7.875v9.021h15.607V78.182h-15.607v9.02zm-1.432 32.503c-.955 2.578-2.291 4.821-4.009 6.73-1.719 1.91-3.795 3.437-6.229 4.582-2.435 1.146-5.133 1.718-8.091 1.718-2.96 0-5.633-.572-8.019-1.718-2.387-1.146-4.438-2.672-6.156-4.582-1.719-1.909-3.032-4.152-3.938-6.73-.909-2.577-1.36-5.298-1.36-8.161 0-2.864.451-5.585 1.36-8.162.905-2.577 2.219-4.819 3.938-6.729 1.718-1.908 3.77-3.437 6.156-4.582 2.386-1.146 5.059-1.718 8.019-1.718 2.958 0 5.656.572 8.091 1.718 2.434 1.146 4.51 2.674 6.229 4.582 1.718 1.91 3.054 4.152 4.009 6.729.953 2.577 1.432 5.298 1.432 8.162 0 2.863-.479 5.584-1.432 8.161zM650.772 44.676h-15.606v100.23h15.606V44.676zM365.013 144.906h15.607V93.538h26.776V78.182h-42.383v66.724zM542.133 78.182l-19.616 51.096-19.616-51.096h-15.808l25.617 66.724h19.614l25.617-66.724h-15.808zM591.98 76.466c-19.112 0-34.239 15.706-34.239 35.079 0 21.416 14.641 35.079 36.239 35.079 12.088 0 19.806-4.622 29.234-14.688l-10.544-8.158c-.006.008-7.958 10.449-19.832 10.449-13.802 0-19.612-11.127-19.612-16.884h51.777c2.72-22.043-11.772-40.877-33.023-40.877zm-18.713 29.28c.12-1.284 1.917-16.884 18.589-16.884 16.671 0 18.697 15.598 18.813 16.884h-37.402zM184.068 43.892c-.024-.088-.073-.165-.104-.25-.058-.157-.108-.316-.191-.46-.056-.097-.137-.176-.203-.265-.087-.117-.161-.242-.265-.345-.085-.086-.194-.148-.29-.223-.109-.085-.206-.182-.327-.252l-.002-.001-.002-.002-35.648-20.524a2.971 2.971 0 00-2.964 0l-35.647 20.522-.002.002-.002.001c-.121.07-.219.167-.327.252-.096.075-.205.138-.29.223-.103.103-.178.228-.265.345-.066.089-.147.169-.203.265-.083.144-.133.304-.191.46-.031.085-.08.162-.104.25-.067.249-.103.51-.103.776v38.979l-29.706 17.103V24.493a3 3 0 00-.103-.776c-.024-.088-.073-.165-.104-.25-.058-.157-.108-.316-.191-.46-.056-.097-.137-.176-.203-.265-.087-.117-.161-.242-.265-.345-.085-.086-.194-.148-.29-.223-.109-.085-.206-.182-.327-.252l-.002-.001-.002-.002L40.098 1.396a2.971 2.971 0 00-2.964 0L1.487 21.919l-.002.002-.002.001c-.121.07-.219.167-.327.252-.096.075-.205.138-.29.223-.103.103-.178.228-.265.345-.066.089-.147.169-.203.265-.083.144-.133.304-.191.46-.031.085-.08.162-.104.25-.067.249-.103.51-.103.776v122.09c0 1.063.568 2.044 1.489 2.575l71.293 41.045c.156.089.324.143.49.202.078.028.15.074.23.095a2.98 2.98 0 001.524 0c.069-.018.132-.059.2-.083.176-.061.354-.119.519-.214l71.293-41.045a2.971 2.971 0 001.489-2.575v-38.979l34.158-19.666a2.971 2.971 0 001.489-2.575V44.666a3.075 3.075 0 00-.106-.774zM74.255 143.167l-29.648-16.779 31.136-17.926.001-.001 34.164-19.669 29.674 17.084-21.772 12.428-43.555 24.863zm68.329-76.259v33.841l-12.475-7.182-17.231-9.92V49.806l12.475 7.182 17.231 9.92zm2.97-39.335l29.693 17.095-29.693 17.095-29.693-17.095 29.693-17.095zM54.06 114.089l-12.475 7.182V46.733l17.231-9.92 12.475-7.182v74.537l-17.231 9.921zM38.614 7.398l29.693 17.095-29.693 17.095L8.921 24.493 38.614 7.398zM5.938 29.632l12.475 7.182 17.231 9.92v79.676l.001.005-.001.006c0 .114.032.221.045.333.017.146.021.294.059.434l.002.007c.032.117.094.222.14.334.051.124.088.255.156.371a.036.036 0 00.004.009c.061.105.149.191.222.288.081.105.149.22.244.314l.008.01c.084.083.19.142.284.215.106.083.202.178.32.247l.013.005.011.008 34.139 19.321v34.175L5.939 144.867V29.632h-.001zm136.646 115.235l-65.352 37.625V148.31l48.399-27.628 16.953-9.677v33.862zm35.646-61.22l-29.706 17.102V66.908l17.231-9.92 12.475-7.182v33.841z"/&amp;gt;
                        &amp;lt;/g&amp;gt;
                    &amp;lt;/svg&amp;gt;
                &amp;lt;/div&amp;gt;

                &amp;lt;div class="mt-8 bg-white dark:bg-gray-800 overflow-hidden shadow sm:rounded-lg"&amp;gt;
                    &amp;lt;div class="grid grid-cols-1 md:grid-cols-2"&amp;gt;
                        &amp;lt;div id="scanner" class="p-6 border-t border-gray-200 dark:border-gray-700 md:border-t-0 md:border-l"&amp;gt;

                        &amp;lt;/div&amp;gt;
                        &amp;lt;div class="p-6 border-t border-gray-200 dark:border-gray-700 md:border-t-0 md:border-l"&amp;gt;
                            &amp;lt;div class="flex items-center"&amp;gt;
                                &amp;lt;svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" class="w-8 h-8 text-gray-500"&amp;gt;&amp;lt;path d="M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"&amp;gt;&amp;lt;/path&amp;gt;&amp;lt;path d="M15 13a3 3 0 11-6 0 3 3 0 016 0z"&amp;gt;&amp;lt;/path&amp;gt;&amp;lt;/svg&amp;gt;
                                &amp;lt;div class="ml-4 text-lg leading-7 font-semibold"&amp;gt;&amp;lt;a href="" class="underline text-gray-900 dark:text-white"&amp;gt;Laravel QR Scanner Using Webcam&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;
                            &amp;lt;/div&amp;gt;

                            &amp;lt;div class="ml-12"&amp;gt;
                                &amp;lt;div class="mt-2 text-gray-600 dark:text-gray-400 text-sm"&amp;gt;
                                    A QR code scanner is a device or software that can read and decode QR codes. QR codes are two-dimensional barcodes that can store a variety of information, such as text, URLs, contact information, and more.
                                &amp;lt;/div&amp;gt;
                            &amp;lt;/div&amp;gt;
                            &amp;lt;div class="ml-12"&amp;gt;
                                &amp;lt;textarea id="scannedTextMemo" cols="50" class="mt-2 form-control" rows="2" readonly&amp;gt;&amp;lt;/textarea&amp;gt;
                            &amp;lt;/div&amp;gt;
                            &amp;lt;div class="ml-12"&amp;gt;
                                &amp;lt;textarea id="scannedTextMemoHist" class="mt-2 form-control" value="" cols="50" rows="10" readonly&amp;gt;&amp;lt;/textarea&amp;gt;
                            &amp;lt;/div&amp;gt;
                        &amp;lt;/div&amp;gt;
                    &amp;lt;/div&amp;gt;
                &amp;lt;/div&amp;gt;

                &amp;lt;div class="flex justify-center mt-4 sm:items-center sm:justify-between"&amp;gt;
                    &amp;lt;div class="ml-4 text-center text-sm text-gray-500 sm:text-right sm:ml-0"&amp;gt;
                        Laravel v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }})
                    &amp;lt;/div&amp;gt;
                &amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;

&amp;lt;script type="text/javascript"&amp;gt;
    function onQRCodeScanned(scannedText)
    {
        var scannedTextMemo = document.getElementById("scannedTextMemo");
        if(scannedTextMemo)
        {
            scannedTextMemo.value = scannedText;
        }
        var scannedTextMemoHist = document.getElementById("scannedTextMemoHist");
        if(scannedTextMemoHist)
        {
            scannedTextMemoHist.value = scannedTextMemoHist.value + '\n' + scannedText;
        }
    }

    function provideVideo()
    {
        var n = navigator;

        if (n.mediaDevices &amp;amp;&amp;amp; n.mediaDevices.getUserMedia)
        {
          return n.mediaDevices.getUserMedia({
            video: {
              facingMode: "environment"
            },
            audio: false
          });
        } 

        return Promise.reject('Your browser does not support getUserMedia');
    }

    function provideVideoQQ()
    {
        return navigator.mediaDevices.enumerateDevices()
        .then(function(devices) {
            var exCameras = [];
            devices.forEach(function(device) {
            if (device.kind === 'videoinput') {
              exCameras.push(device.deviceId)
            }
         });

            return Promise.resolve(exCameras);
        }).then(function(ids){
            if(ids.length === 0)
            {
              return Promise.reject('Could not find a webcam');
            }

            return navigator.mediaDevices.getUserMedia({
                video: {
                  'optional': [{
                    'sourceId': ids.length === 1 ? ids[0] : ids[1]//this way QQ browser opens the rear camera
                    }]
                }
            });        
        });                
    }

    //this function will be called when JsQRScanner is ready to use
    function JsQRScannerReady()
    {
        //create a new scanner passing to it a callback function that will be invoked when
        //the scanner succesfully scan a QR code
        var jbScanner = new JsQRScanner(onQRCodeScanned);
        //var jbScanner = new JsQRScanner(onQRCodeScanned, provideVideo);
        //reduce the size of analyzed image to increase performance on mobile devices
        jbScanner.setSnapImageMaxSize(300);
        var scannerParentElement = document.getElementById("scanner");
        if(scannerParentElement)
        {
            //append the jbScanner to an existing DOM element
            jbScanner.appendTo(scannerParentElement);
        }        
    }
  &amp;lt;/script&amp;gt;   
    &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Test &amp;amp; run laravel project &amp;amp; and try open &lt;a href="http://localhost:8000/"&gt;http://localhost:8000/&lt;/a&gt; in your browser
&lt;/li&gt;
&lt;/ul&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2Ve4VRBL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q06le1ps2m8uzraowqfy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2Ve4VRBL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q06le1ps2m8uzraowqfy.png" alt="Image description" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you need full example code, please clone from this link : &lt;a href="https://gitlab.com/open-for-public/laravel-qr-scanner-using-webcam.git"&gt;https://gitlab.com/open-for-public/laravel-qr-scanner-using-webcam.git&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>laravel</category>
      <category>javascript</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Detect Bugs &amp; Vulnerabilities and get instant feedback. Lumen - Sonarcloud Integration</title>
      <dc:creator>Iqbal Syahrul Siddiq</dc:creator>
      <pubDate>Fri, 25 Aug 2023 07:21:41 +0000</pubDate>
      <link>https://dev.to/iqbalsyahrulsiddiq/detect-bugs-vulnerabilities-and-get-instant-feedback-laravel-sonarcloud-integration-4435</link>
      <guid>https://dev.to/iqbalsyahrulsiddiq/detect-bugs-vulnerabilities-and-get-instant-feedback-laravel-sonarcloud-integration-4435</guid>
      <description>&lt;h2&gt;
  
  
  What is Sonarcloud ?
&lt;/h2&gt;

&lt;p&gt;SonarCloud is a cloud-based code analysis service designed to detect coding issues in 26 different programming languages. By integrating directly with your CI pipeline or one of our supported DevOps platforms, your code is checked against an extensive set of rules that cover many attributes of code, such as maintainability, reliability, and security issues on each merge/pull request. As a core element of our Sonar solution, SonarCloud completes the analysis loop to help you deliver clean code that meets high-quality standards.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CTIwsjjf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7nwe3uwz1a16fige8iys.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CTIwsjjf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7nwe3uwz1a16fige8iys.png" alt="Dev Cycle" width="800" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SonarCloud uses state-of-the-art techniques in static code analysis to find problems and potential problems in the code that you and your team write. Static analysis is called static because it does not rely on actually running the code.  As a result, SonarCloud offers an additional layer of verification, different from automated testing and manual code review. Its powerful set of language-specific analyzers uses thousands of rules to track down hard-to-find bugs and quality issues - from simple coding mistakes, and tricky bugs, to advanced issues and security vulnerabilities such as injection flaws. Early detection of problems during static analysis ensures that fewer issues get through to the later stages of the process and ultimately helps to increase the overall quality of your production code. &lt;/p&gt;

&lt;p&gt;As a core element of our Sonar solution, SonarCloud integrates into your existing workflow and detects issues in your code to help you perform continuous code inspections of your projects. It achieves this by integrating into your CI pipeline or DevOps platform thus, extending your DevOps experience by importing your projects and performing automated code checks within minutes. SonarCloud works with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Github&lt;/li&gt;
&lt;li&gt;Bitbucket Cloud&lt;/li&gt;
&lt;li&gt;Azure DevOps&lt;/li&gt;
&lt;li&gt;Gitlab&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;SonarCloud does not work with on-premises code repositories. For on-premise support.&lt;/p&gt;

&lt;p&gt;In this tutorial, i would like to tell you how to integrated Sonarcloud. Make simple dev-cylce (Laravel, Gitlab, and Sonarcloud)&lt;/p&gt;

&lt;h2&gt;
  
  
  Create Workspace / Project Group in Gitlab
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Open and sign in to your Gitlab account &lt;a href="https://gitlab.com/users/sign_in"&gt;https://gitlab.com/users/sign_in&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LGCk7fnX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0d77jmgzuf2kxsk30t5q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LGCk7fnX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0d77jmgzuf2kxsk30t5q.png" alt="Image description" width="800" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On the sidebar, click "Group"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vhyVwTZZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p0hmynx0rcvvtj2vsgzi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vhyVwTZZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p0hmynx0rcvvtj2vsgzi.png" alt="Image description" width="514" height="730"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click "New Group" button (if you want to make new project group)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LSDTTGWQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/grxz4ig1chuc0feaw0k6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LSDTTGWQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/grxz4ig1chuc0feaw0k6.png" alt="Image description" width="800" height="122"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click "Create Group"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7kcerZyc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b0bbdttg1dy28lgdliva.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7kcerZyc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b0bbdttg1dy28lgdliva.png" alt="Image description" width="800" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Fill out the form, choose your permission access for your workspace (public / private), in this tutorial i will choose "public", and submit "Create Group"&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sonarcloud need personal access token from your Gitlab account. So, you have to generate your token, open your account setting menu, or click on this link : &lt;a href="https://gitlab.com/-/profile/personal_acc"&gt;https://gitlab.com/-/profile/personal_acc&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click "add new token"&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tdv09Wrp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6r0jwhwz9lsd0mtrmtzc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tdv09Wrp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6r0jwhwz9lsd0mtrmtzc.png" alt="Image description" width="800" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You have to fill &lt;em&gt;token name&lt;/em&gt; , &lt;em&gt;expiration date&lt;/em&gt;&amp;amp; checked &lt;em&gt;api&lt;/em&gt; option&lt;/li&gt;
&lt;li&gt;Click &lt;em&gt;"create personal access token&lt;/em&gt; button&lt;/li&gt;
&lt;li&gt;Copy, yor personal access token to some notes (&lt;strong&gt;important&lt;/strong&gt; : you only can copy token in first time after token generated, make sure you saved it)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Qkt4s-gc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vgbm5j75w9ybzvmxxs4n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Qkt4s-gc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vgbm5j75w9ybzvmxxs4n.png" alt="Image description" width="800" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Register Sonarcloud Account
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Open your browser, and visit this link : &lt;a href="https://www.sonarsource.com/products/sonarcloud/"&gt;https://www.sonarsource.com/products/sonarcloud/&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cBxLhJUU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tnw59pfviy9el9xfo29g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cBxLhJUU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tnw59pfviy9el9xfo29g.png" alt="Image description" width="800" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click on "Sign Up" button&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ziAnUWBX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/85ti073p78lcaudk2z16.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ziAnUWBX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/85ti073p78lcaudk2z16.png" alt="Image description" width="800" height="136"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can choose account that's you want to integrated, in this tutorial i will using &lt;strong&gt;&lt;em&gt;gitlab account&lt;/em&gt;&lt;/strong&gt; , click on &lt;strong&gt;&lt;em&gt;gitlab button&lt;/em&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WsrDf6PR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uwnba3sy0z49dxma515v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WsrDf6PR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uwnba3sy0z49dxma515v.png" alt="Image description" width="800" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next, please click on &lt;strong&gt;&lt;em&gt;authorize&lt;/em&gt;&lt;/strong&gt; (Sonarcloud require access to Gitlab repository)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RNH9JSFY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ytn5kp5valj8d257cib9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RNH9JSFY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ytn5kp5valj8d257cib9.png" alt="Image description" width="800" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If it's your first time using Sonarcloud, you will see this blank page. It's mean nothing project exist in your account&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--W0kn3A6p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8k0vn07x26zlhnx0gvu4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--W0kn3A6p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8k0vn07x26zlhnx0gvu4.png" alt="Image description" width="800" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's continue&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup Sonarcloud
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Next, you have to setup sonarcloud, from the blank page, click on button &lt;strong&gt;&lt;em&gt;analyze new project&lt;/em&gt;&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BvW9ElVM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7hib77v9upe9n3cof4a3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BvW9ElVM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7hib77v9upe9n3cof4a3.png" alt="Image description" width="800" height="274"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click &lt;strong&gt;&lt;em&gt;Import a new Organization&lt;/em&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gqaF8655--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jp9msn01ndfh1hfid26s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gqaF8655--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jp9msn01ndfh1hfid26s.png" alt="Image description" width="800" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next, in this tutorial i want to integrated Sonarcloud with some my personal workspace / project group in Gitlab, so, click in &lt;strong&gt;&lt;em&gt;Import any Gitlab group&lt;/em&gt;&lt;/strong&gt; (if you choose for &lt;em&gt;import private gitlab&lt;/em&gt; you have to paid to Sonarcloud / nothing free package)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gh9ZfQN2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qbevadv0unuu12m8itjj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gh9ZfQN2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qbevadv0unuu12m8itjj.png" alt="Image description" width="800" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Copy and paste your &lt;em&gt;personal access token&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Copy and paste your &lt;em&gt;group id&lt;/em&gt; as group key value (you can fund group id on group setting (Group -&amp;gt; select your group -&amp;gt; setting -&amp;gt; general)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rLrJFR6z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hf0e9lzgbbgwhpa4j6rv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rLrJFR6z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hf0e9lzgbbgwhpa4j6rv.png" alt="Image description" width="800" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click "Continue"&lt;/li&gt;
&lt;li&gt;Next, scroll down page, and you have to choose a plan (in this tutorial i will try free version)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Pm-IggRn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aty8p0hwasvoti6rkq23.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Pm-IggRn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aty8p0hwasvoti6rkq23.png" alt="Image description" width="800" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click "create organization"&lt;/li&gt;
&lt;li&gt;Great, your sonarcloud setup is done, next let's back to Gitlab repository&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zkL7UIOX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fle2ilx1n95ew70mwwje.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zkL7UIOX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fle2ilx1n95ew70mwwje.png" alt="Image description" width="800" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create a new project in workspace / group Gitlab (for testing)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Open your gitlab group, and &lt;em&gt;create new project&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8GAfkWnH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/huba7uixdm4kw5niixgb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8GAfkWnH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/huba7uixdm4kw5niixgb.png" alt="Image description" width="800" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In this tutorial, i will upload my mini project using Lumen (Laravel Microframework) to gitlab group project *actually you can using another framework, setup process is same.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;em&gt;create blank project&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kWL7yH8H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hef2ft0h2tgmuscnif44.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kWL7yH8H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hef2ft0h2tgmuscnif44.png" alt="Image description" width="800" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fill the form, and click &lt;em&gt;create project&lt;/em&gt; (&lt;strong&gt;&lt;em&gt;if you want to use free version sonarcloud, please choose "public access" on your project&lt;/em&gt;&lt;/strong&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UfkgAPrN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c27q21z27yruoeu15pxt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UfkgAPrN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c27q21z27yruoeu15pxt.png" alt="Image description" width="800" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Registered project into Sonarcloud
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Click on &lt;em&gt;analyze a new project&lt;/em&gt; button &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---ccIkY0I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/go2rpf5qkcplhpzh65m1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---ccIkY0I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/go2rpf5qkcplhpzh65m1.png" alt="Image description" width="800" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sonarcloud will check and listed your public project in workspace&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--l-gisZKx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zerab49unp9jk1o840ed.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--l-gisZKx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zerab49unp9jk1o840ed.png" alt="Image description" width="800" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select the project, and click &lt;em&gt;setup&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ia9ahY1T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/807x788lmvttikwtpcjf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ia9ahY1T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/807x788lmvttikwtpcjf.png" alt="Image description" width="800" height="409"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose &lt;em&gt;previous version&lt;/em&gt; or &lt;em&gt;number of days&lt;/em&gt; (it's based on your preferences, you can change anytime). In this tutorial, i will choose &lt;strong&gt;&lt;em&gt;previous version&lt;/em&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mLG-WEhr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/piw6flpajbx7ggcuz399.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mLG-WEhr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/piw6flpajbx7ggcuz399.png" alt="Image description" width="800" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click &lt;em&gt;create project&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Choose &lt;em&gt;With Gilab CI/CD pipeline&lt;/em&gt; for analysis method&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eStHykZ---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/90ellr6gij4lab8vxgf6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eStHykZ---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/90ellr6gij4lab8vxgf6.png" alt="Image description" width="800" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You have to add some Sonarcloud credential (token variable and URL) to your Gitlab repository, please follow instructions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3kCk1dnW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0wt5w1j4nvyubp9gm89x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3kCk1dnW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0wt5w1j4nvyubp9gm89x.png" alt="Image description" width="800" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add credential &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oW7RskK4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ivwzgd878vby7bkynwnl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oW7RskK4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ivwzgd878vby7bkynwnl.png" alt="Image description" width="800" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next, you have to add a new file .yml (.gitlab-ci.yml) to your project folder root. Choose your programming languages, make sure it's match (In this tutorial i using Lumen, so i choose PHP version)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9ussggrE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/32vcyvefa4plo0luovsn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9ussggrE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/32vcyvefa4plo0luovsn.png" alt="Image description" width="800" height="412"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;variables:
  SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar"  # Defines the location of the analysis task cache
  GIT_DEPTH: "0"  # Tells git to fetch all the branches of the project, required by the analysis task
sonarcloud-check:
  image:
    name: sonarsource/sonar-scanner-cli:latest
    entrypoint: [""]
  cache:
    key: "${CI_JOB_NAME}"
    paths:
      - .sonar/cache
  script:
    - sonar-scanner
  only:
    - merge_requests
    - main
    - develop

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

&lt;/div&gt;



&lt;p&gt;In the last line of code, you have to make sure branch names repository is correct, as default Sonarcloud named main branch as "master", but in gitlab, main branch named as "main", so you have to change "master" to "main"&lt;/p&gt;

&lt;p&gt;You can add the branch name when the Sonarcloud will analysis your code.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the last step of instructions, you have to create a new file (sonar-project.properties)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sonar.projectKey=open-for-public_lumen-restfull-api-with-jwt-authentication
sonar.organization=open-for-public

# This is the name and version displayed in the SonarCloud UI.
#sonar.projectName=Lumen Restfull API With JWT Authentication
#sonar.projectVersion=1.0


# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
#sonar.sources=.

# Encoding of the source code. Default is default system encoding
#sonar.sourceEncoding=UTF-8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ObPCiTTT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bjev2gs50vxjflq3j8q0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ObPCiTTT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bjev2gs50vxjflq3j8q0.png" alt="Image description" width="662" height="1006"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You're Done&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Testing
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Push your code using git command &lt;/li&gt;
&lt;li&gt;Open &lt;strong&gt;&lt;em&gt;my project&lt;/em&gt;&lt;/strong&gt; menu in Sonarcloud sites&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vLrJg-d5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jd98m169t91rcsfbn4ar.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vLrJg-d5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jd98m169t91rcsfbn4ar.png" alt="Image description" width="800" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;After push process finish, refresh &lt;em&gt;my project&lt;/em&gt; page in Sonarcloud (it'usually takes 1 - 3 minute of analysis process, depend on line of number line of code.)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If analysis finish, the result will show in page &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1uNbZjTq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ua5un3yoyn0ofypy872t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1uNbZjTq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ua5un3yoyn0ofypy872t.png" alt="Image description" width="800" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eLRM-G0u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5awht5y8wn9en6qa7kof.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eLRM-G0u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5awht5y8wn9en6qa7kof.png" alt="Image description" width="800" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RdFfmK_s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2xbzy8907dtc1d4lwqpv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RdFfmK_s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2xbzy8907dtc1d4lwqpv.png" alt="Image description" width="800" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Great, you're done, i hope this article help you. See you on the next post&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>sonarcloud</category>
      <category>vulnerabilities</category>
      <category>security</category>
    </item>
    <item>
      <title>Lumen Tutorial : How to build a JWT Authenticated API with Lumen</title>
      <dc:creator>Iqbal Syahrul Siddiq</dc:creator>
      <pubDate>Sun, 20 Aug 2023 16:22:45 +0000</pubDate>
      <link>https://dev.to/iqbalsyahrulsiddiq/lumen-tutorial-how-to-build-a-jwt-authenticated-api-with-lumen-4144</link>
      <guid>https://dev.to/iqbalsyahrulsiddiq/lumen-tutorial-how-to-build-a-jwt-authenticated-api-with-lumen-4144</guid>
      <description>&lt;p&gt;A JSON web token(JWT) is JSON Object which is used to securely transfer information over the web(between two parties). It can be used for an authentication system and can also be used for information exchange.&lt;/p&gt;

&lt;p&gt;The token is mainly composed of header, payload, signature. These three parts are separated by dots(.). JWT defines the structure of information we are sending from one party to the another, and it comes in two forms – Serialized, Deserialized. &lt;/p&gt;

&lt;p&gt;The Serialized approach is mainly used to transfer the data through the network with each request and response. While the deserialized approach is used to read and write data to the web token.&lt;/p&gt;

&lt;p&gt;In this tutorial, i would like to show you how to build a JWT Authenticated API with Lumen 8.&lt;/p&gt;

&lt;p&gt;Let's code !!&lt;/p&gt;

&lt;h2&gt;
  
  
  Install Lumen
&lt;/h2&gt;

&lt;p&gt;First step, you have to install new lumen project. If you want to use latest version of lumen, you can run command below :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer create-project --prefer-dist laravel/lumen blog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;but, if you want to using specific version of lumen, you can run command below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer create-project laravel/lumen blog "5.*.*"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you just have to change main version number (5, 6, 7, 8, etc)&lt;/p&gt;

&lt;h2&gt;
  
  
  Make Migration for Database
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Make sure, your env file connected to some database address
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DB_CONNECTION=mysql
DB_HOST=type-your-host-here
DB_PORT=3306
DB_DATABASE=type-your-db-here
DB_USERNAME=type-your-username
DB_PASSWORD=type-your-password
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Create a new migration file, run this command
&lt;/li&gt;
&lt;/ul&gt;

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Open migration file, and add code below
&lt;/li&gt;
&lt;/ul&gt;

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

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table-&amp;gt;id();
            $table-&amp;gt;string('name');
            $table-&amp;gt;string('email')-&amp;gt;unique();
            $table-&amp;gt;timestamp('email_verified_at')-&amp;gt;nullable();
            $table-&amp;gt;string('password');
            $table-&amp;gt;rememberToken();
            $table-&amp;gt;timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Run the migration
&lt;/li&gt;
&lt;/ul&gt;

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

&lt;/div&gt;



&lt;p&gt;This command, will execute migration file and create new tables in your database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install JWT Package
&lt;/h2&gt;

&lt;p&gt;install jwt-auth via composer&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer require tymon/jwt-auth:*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Generate JWT Secret Key
&lt;/h2&gt;

&lt;p&gt;Generate key secret JWT, run command below&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 jwt:secret
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Setup Folder &amp;amp; Important Config File
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Create new folder, named it &lt;em&gt;config&lt;/em&gt; (same level with &lt;em&gt;app&lt;/em&gt; folder)&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You have to copy file from &lt;em&gt;vendor/tymon/jwt-auth/config/config.php&lt;/em&gt; to &lt;em&gt;config&lt;/em&gt; folder, and rename file to &lt;em&gt;jwt.php&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Next, make new file inside &lt;em&gt;config&lt;/em&gt; folder, &lt;em&gt;auth.php&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--APgyEMwa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/92ix6k02q28j650zfywe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--APgyEMwa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/92ix6k02q28j650zfywe.png" alt="Image description" width="610" height="516"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open file &lt;em&gt;app.php&lt;/em&gt; (bootstrap/app.php), edit and add this code
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Uncomment this line
$app-&amp;gt;withFacades();
$app-&amp;gt;withEloquent();

// Add this line
$app-&amp;gt;configure('jwt');
$app-&amp;gt;configure('auth');

//Then uncomment the auth middleware 
$app-&amp;gt;routeMiddleware([
    'auth' =&amp;gt; App\Http\Middleware\Authenticate::class,
]);

$app-&amp;gt;register(App\Providers\AuthServiceProvider::class);

// Add this line in the same file:
$app-&amp;gt;register(Tymon\JWTAuth\Providers\LumenServiceProvider::class);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Open &lt;em&gt;auth.php&lt;/em&gt; (config/auth.php) add this code
&lt;/li&gt;
&lt;/ul&gt;

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

return [
    'defaults' =&amp;gt; [
        'guard' =&amp;gt; 'api',
        'passwords' =&amp;gt; 'users',
    ],

    'guards' =&amp;gt; [
        'api' =&amp;gt; [
            'driver' =&amp;gt; 'jwt',
            'provider' =&amp;gt; 'users',
        ],
    ],

    'providers' =&amp;gt; [
        'users' =&amp;gt; [
            'driver' =&amp;gt; 'eloquent',
            'model' =&amp;gt; \App\Models\User::class
        ]
    ]
];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Create Model
&lt;/h2&gt;

&lt;p&gt;Let's make new file model, User.php (app/models/user.php), add code below :&lt;br&gt;
&lt;/p&gt;

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

namespace App\Models;

use Illuminate\Auth\Authenticatable;
use Laravel\Lumen\Auth\Authorizable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;

//this is new
use Tymon\JWTAuth\Contracts\JWTSubject;

class User extends Model implements AuthenticatableContract, AuthorizableContract, JWTSubject 
{
    use Authenticatable, Authorizable;

    /**
     * Get the identifier that will be stored in the subject claim of the JWT.
     *
     * @return mixed
     */
    public function getJWTIdentifier()
    {
        return $this-&amp;gt;getKey();
    }

    /**
     * Return a key value array, containing any custom claims to be added to the JWT.
     *
     * @return array
     */
    public function getJWTCustomClaims()
    {
        return [];
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Create Controller
&lt;/h2&gt;

&lt;p&gt;Next, you have to make new controller file, &lt;em&gt;AuthController&lt;/em&gt; (app/http/controllers/AuthController), add thic code :&lt;br&gt;
&lt;/p&gt;

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

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use App\Models\User;

class AuthController extends Controller
{

    public function __construct()
    {
        $this-&amp;gt;middleware('auth:api', ['except' =&amp;gt; ['login', 'refresh', 'logout']]);
    }
    /**
     * Get a JWT via given credentials.
     *
     * @param  Request  $request
     * @return Response
     */
    public function login(Request $request)
    {

        $this-&amp;gt;validate($request, [
            'email' =&amp;gt; 'required|string',
            'password' =&amp;gt; 'required|string',
        ]);

        $credentials = $request-&amp;gt;only(['email', 'password']);

        if (! $token = Auth::attempt($credentials)) {
            return response()-&amp;gt;json(['message' =&amp;gt; 'Unauthorized'], 401);
        }

        return $this-&amp;gt;respondWithToken($token);
    }

     /**
     * Get the authenticated User.
     *
     * @return \Illuminate\Http\JsonResponse
     */
    public function me()
    {
        return response()-&amp;gt;json(auth()-&amp;gt;user());
    }

    /**
     * Log the user out (Invalidate the token).
     *
     * @return \Illuminate\Http\JsonResponse
     */
    public function logout()
    {
        auth()-&amp;gt;logout();

        return response()-&amp;gt;json(['message' =&amp;gt; 'Successfully logged out']);
    }

    /**
     * Refresh a token.
     *
     * @return \Illuminate\Http\JsonResponse
     */
    public function refresh()
    {
        return $this-&amp;gt;respondWithToken(auth()-&amp;gt;refresh());
    }

    /**
     * Get the token array structure.
     *
     * @param  string $token
     *
     * @return \Illuminate\Http\JsonResponse
     */
    protected function respondWithToken($token)
    {
        return response()-&amp;gt;json([
            'access_token' =&amp;gt; $token,
            'token_type' =&amp;gt; 'bearer',
            'user' =&amp;gt; auth()-&amp;gt;user(),
            'expires_in' =&amp;gt; auth()-&amp;gt;factory()-&amp;gt;getTTL() * 60 * 24
        ]);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Setup Route
&lt;/h2&gt;

&lt;p&gt;Open &lt;em&gt;web.php&lt;/em&gt; file (routes/web.php), add this code&lt;br&gt;
&lt;/p&gt;

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

/** @var \Laravel\Lumen\Routing\Router $router */

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$router-&amp;gt;get('/', function () use ($router) {
    return $router-&amp;gt;app-&amp;gt;version();
});

$router-&amp;gt;get('/get-key', function() {
    return \Illuminate\Support\Str::random(32);
});

Route::group([

    'prefix' =&amp;gt; 'api'

], function ($router) {
    Route::post('login', 'AuthController@login');
    Route::post('logout', 'AuthController@logout');
    Route::post('refresh', 'AuthController@refresh');
    Route::post('user-profile', 'AuthController@me');

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Add Encryption key Application
&lt;/h2&gt;

&lt;p&gt;You can't run &lt;em&gt;php artisan key:generate&lt;/em&gt; in lumen (like in Laravel), so you have to generate manually by call route /get-key&lt;/p&gt;

&lt;p&gt;Open browser, visit this link &lt;em&gt;&lt;a href="http://localhost:8000/get-key"&gt;http://localhost:8000/get-key&lt;/a&gt;&lt;/em&gt; , copy and paste the key to APP_KEY in env file &lt;/p&gt;

&lt;h2&gt;
  
  
  Refresh ENV Setup
&lt;/h2&gt;

&lt;p&gt;After you change env file, you have to run&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 cache:clear
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Running Lumen
&lt;/h2&gt;

&lt;p&gt;Run lumen with this command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php -S localhost:8000 -t public
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open Postman to test your API endpoint's&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;_You can clone example code by this link : _&lt;/strong&gt; &lt;a href="https://gitlab.com/open-for-public/lumen-restfull-api-with-jwt-authentication.git"&gt;https://gitlab.com/open-for-public/lumen-restfull-api-with-jwt-authentication.git&lt;/a&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>lumen</category>
      <category>jwt</category>
    </item>
  </channel>
</rss>
