<?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: Elanor</title>
    <description>The latest articles on DEV Community by Elanor (@oranges13).</description>
    <link>https://dev.to/oranges13</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%2F342304%2F82f9682f-6e10-48bc-8c80-859df7a2282b.jpeg</url>
      <title>DEV Community: Elanor</title>
      <link>https://dev.to/oranges13</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/oranges13"/>
    <language>en</language>
    <item>
      <title>Onboarding New Developers (a series) - The First Week</title>
      <dc:creator>Elanor</dc:creator>
      <pubDate>Sat, 04 Sep 2021 02:56:34 +0000</pubDate>
      <link>https://dev.to/oranges13/onboarding-new-developers-a-series-the-first-week-4a24</link>
      <guid>https://dev.to/oranges13/onboarding-new-developers-a-series-the-first-week-4a24</guid>
      <description>&lt;p&gt;In this series, I'm going over how I onboarded a new hire into my development team. I wasn't given a lot of predefined onboarding resources, so I had to develop a plan of my own. If you missed the intro, make sure to read it to have a better understanding of what information I used to make my onboarding plan.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/oranges13/onboarding-new-developers-a-series-1n40"&gt;Read the Introductory Post Here&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The First Week
&lt;/h2&gt;

&lt;p&gt;The First Week with your new developer will depend heavily on your goals for the employee within your team, and your organization’s onboarding process. For instance, a previous company I worked for spent the first entire week as a cohort of new hires learning about the company’s history and the industry as a whole. Very little time was actually spent with the employee’s actual team during the first week.&lt;/p&gt;

&lt;p&gt;If this is the case for your organization, consider “The First Week” to be the first week that the employee can spend with you on a dedicated basis. For my employee’s first week I wanted them to have the resources they needed to be successful, and if they didn’t have those resources yet, to ensure that all requests were in process so that we had a timeline when they could be fully up to speed.&lt;/p&gt;

&lt;p&gt;I set up a schedule for the first week with bullet points to get the new hire up to speed with their team members, our normal meeting schedule, and the company culture, as well as the tools we use. There was &lt;em&gt;zero&lt;/em&gt; expectation that any meaningful work would be done during their first week. &lt;br&gt;
Though it was broken up into different days, the bullet points on each day were not an end-all-be-all set in stone schedule. They could complete tasks on different days as it suited them. My goal was that most of the tasks be completed before the end of the week.&lt;/p&gt;

&lt;p&gt;This schedule included reading materials from our intranet, employee handbook, as well as documentation on the various systems and frameworks that our team uses on a daily basis. Much of this documentation already existed in-house in our Confluence site. If your company doesn’t have resources like these, you may have to come up with some basics and bullet points on your own.&lt;/p&gt;

&lt;p&gt;Here is an example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Monday

&lt;ul&gt;
&lt;li&gt;Meet with Manager&lt;/li&gt;
&lt;li&gt;New Hire Intro with HR&lt;/li&gt;
&lt;li&gt;Get your computer set up the way you like&lt;/li&gt;
&lt;li&gt;Make sure you have all the software you need&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;Tuesday&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read our Team Member Guide (with a link to this resource)&lt;/li&gt;
&lt;li&gt;Read through New Hire Documentation (our HR department has an entire section of our Intranet dedicated to New Hires)&lt;/li&gt;
&lt;li&gt;Read the Slack Guide&lt;/li&gt;
&lt;li&gt;Read the Zoom Guide
(Add any tools or software your team uses to make sure the new employee has plenty of time to get up to speed)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;Wednesday&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mid week check-in with Manager&lt;/li&gt;
&lt;li&gt;Get familiar with &lt;em&gt;framework that we use&lt;/em&gt; (Link to the documentation of the framework or software that your team develops on a regular basis. For example, Laravel, Nuxt, etc)&lt;/li&gt;
&lt;li&gt;Learn about Jira and Confluence (if your company has documentation or other ticket tracking tools, list those in the first week schedule and make sure to answer any questions about their use as early as you can!)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;Thursday&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Learn about our company culture (have the new hire talk to other employees, meet all the team members and other people at all levels of the company if possible)&lt;/li&gt;
&lt;li&gt;Schedule a meeting with a team member and get to know them (preferably someone outside our team)&lt;/li&gt;
&lt;li&gt;Get familiar with our Development Process (this included a link to our “Developer Manifesto”)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;Friday&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Order any office supplies you need to make your home office productive!&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  First week overall goal
&lt;/h2&gt;

&lt;p&gt;The new hire has the tools and resources to get some actual work done next week. They’ve met their teammates, they have the software they need to get started, and their access to systems and code they will need has been set up. They should already have (or be in the process of receiving) equipment and licenses necessary to be a productive member of the team, starting on Monday.&lt;/p&gt;

&lt;h2&gt;
  
  
  So What's Next?
&lt;/h2&gt;

&lt;p&gt;Your employee should be on good footing to do some actual work next week. Start them off at their comfort level (and that of your team's) with paired programming or a small individual ticket.&lt;/p&gt;

&lt;p&gt;It's important &lt;em&gt;not&lt;/em&gt; to micromanage them. No one enjoys micromanagement. Allow them the freedom to figure out how they fit within your team, but give them the tools and structure to succeed.&lt;/p&gt;

&lt;p&gt;The next post in this series will go over the 30-day plan, and how to keep your employee engaged and active as they get used to working with you and your company!&lt;/p&gt;

</description>
      <category>onboarding</category>
      <category>developers</category>
      <category>teams</category>
    </item>
    <item>
      <title>Onboarding New Developers (a series)</title>
      <dc:creator>Elanor</dc:creator>
      <pubDate>Thu, 26 Aug 2021 21:05:50 +0000</pubDate>
      <link>https://dev.to/oranges13/onboarding-new-developers-a-series-1n40</link>
      <guid>https://dev.to/oranges13/onboarding-new-developers-a-series-1n40</guid>
      <description>&lt;p&gt;Congratulations! You’ve hired a new employee! But what now? Maybe your company has a regimented onboarding process for new employees already. Maybe it doesn’t. Either way, introducing and integrating them into your team will be a unique, but important process.&lt;/p&gt;

&lt;p&gt;I recently hired and needed to onboard a new developer and, as a new manager myself, did not have a lot of resources to start with. The last thing I wanted was my new employee to arrive and feel overwhelmed or lost during their first few days and weeks. Getting your new employee familiar with procedures, software, and the way your team works at a comfortable pace will go a long way to make them a productive member of the team!&lt;/p&gt;

&lt;p&gt;As I was researching this question: “How do you onboard a new developer?” I came across a lot of different approaches. I took many of the recommendations and combined them with my own desires, if I were that new employee. I was constantly asking myself, “How would I want to be introduced and welcomed to a team?” As you are reading these ideas, make sure that you’re thinking about how you can personalize this process; each team and each employee will be different.&lt;/p&gt;

&lt;p&gt;Let’s get started!&lt;/p&gt;

&lt;h2&gt;
  
  
  What are your goals for your new hire?
&lt;/h2&gt;

&lt;p&gt;The entire onboarding process depends on your goal for the employee as a member of your team. This should also be informed by their role within the team. If they are a junior member, you wouldn’t expect them to be a subject-matter expert or leading project initiatives at the end of their first 90 days. If they’re being hired into a more senior position, however, you should expect them to be comfortable with small leadership tasks at the end of your onboarding process.&lt;/p&gt;

&lt;p&gt;Before you can begin onboarding, or even developing an onboarding plan, you need to consider why this person was hired in the first place. How can they become a contributing member of your team? What tools will they need to be successful? And how can you help?&lt;/p&gt;

&lt;h2&gt;
  
  
  What resources are already available to you?
&lt;/h2&gt;

&lt;p&gt;Don’t reinvent the wheel if you don’t have to. Make sure to fully utilize any resources that your company provides to new hires and gather links to these items in a central location so they are easy for your new hire to access.&lt;br&gt;
Our company has a well-defined goal setting process which it uses to evaluate employee performance at the end of each calendar year. Each employee’s annual goals are linked with our company’s Core Values, so many of the goals of onboarding the new employee were linked with these core values as well.&lt;/p&gt;

&lt;h2&gt;
  
  
  Existing Onboarding Process
&lt;/h2&gt;

&lt;p&gt;More than likely, your company has some sort of dedicated on-boarding process. In the case of my company, the new employee is shipped equipment, granted access to systems and servers, and has accounts created in various benefits and HR management systems. However, there was no concrete onboarding process for our development team. (That’s one of the reasons I’m writing this article; to help managers like you figure out what you might need to be successful!)&lt;/p&gt;

&lt;h3&gt;
  
  
  Intranet
&lt;/h3&gt;

&lt;p&gt;Your company most likely has some sort of repository of internal documents, such as benefits information, employee handbooks, etc. Wherever this may be located, make sure you go over it with your employee so they understand how to access these documents and what is included. Your HR department may go over this, but it can’t hurt to reiterate the importance of reviewing all the important “corporate” stuff.&lt;/p&gt;

&lt;h3&gt;
  
  
  Code Documentation (internal &amp;amp; external)
&lt;/h3&gt;

&lt;p&gt;Hopefully your team maintains some code documentation so that the new employee does not have to rely on face-to-face conversations with other employees. If they do, make sure that your employee has time to read through all of this information and is shown how to access it.&lt;br&gt;
If you don’t have this kind of documentation for your systems and software, you will most likely need to schedule time to walk them through the basics of how the systems operate. This might involve scheduling time with other team members who know more about specific components and can perform adequate walkthroughs.&lt;/p&gt;

&lt;p&gt;Even with technical documentation in writing, ask your new employee how they learn best. It’s possible that they will learn more effectively with a walkthrough than by reading documentation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Team Experts and Mentorship
&lt;/h3&gt;

&lt;p&gt;The most important part of onboarding is integrating the new employee into your team! And a great way to get them integrated is to have your team experts on different parts of your systems mentor the new employee as they are working through tasks that deal with those parts. If you do not have “team experts” or have a few people who may fit the bill, try to identify at least one person who knows the most about a specific facet of your system or software. Have a diverse set of work ready for your new employee to work through, and as they get to each new area, they can pair up with the team expert to learn from their expertise.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting up 1:1s with your new employee
&lt;/h2&gt;

&lt;p&gt;This is actually one of the first steps to a successful onboarding process, in my opinion. You, as the manager, need to be available to your new hire to answer questions and guide them along the process as they get used to the way your team and your company do things. One of the very first tasks you should do when your employee gets access to their calendar is to set up regular meetings with them on an ongoing basis.&lt;/p&gt;

&lt;p&gt;Initially, the 1:1s need to be much more frequent then your normal meeting cadence with your existing team members. For instance, I meet with my team members on a bi-weekly basis. With my new hire, I met with them weekly for the first month and then checked in to see how they felt about moving to the bi-weekly schedule at that point. I was also available for ad-hoc meetings, calls, and slack chats whenever I could be, since I fully expected them to have lots of questions in the first weeks they were with us.&lt;/p&gt;

&lt;p&gt;If you, as the manager, don’t have that kind of availability, try to have a senior member of your team act as a mentor and onboarding guide. (Even if you do have wide availability, having a team mentor is still a good idea). It’s crucial that your new hire isn’t left waiting with questions while they are getting acclimated; they might forget what they wanted to ask and miss out on critical details or make a silly mistake that will take more time to fix down the road. Better that they can address their problems and questions immediately then having to wait.&lt;/p&gt;

&lt;h2&gt;
  
  
  Next Steps
&lt;/h2&gt;

&lt;p&gt;The next step is to take all of this information that you have gathered and make a plan of action for your employees first days and weeks. You don't want your new employee to be overwhelmed with tasks, but you also don't want them sitting at their desk twiddling their thumbs.&lt;/p&gt;

&lt;p&gt;In the next few posts in this series, I will go over a 7-day, 30-day, and 90-day plan to get your employee integrated into your team and become a productive developer at your company!&lt;/p&gt;

</description>
      <category>onboarding</category>
      <category>developers</category>
      <category>teams</category>
    </item>
    <item>
      <title>Starting up a new Statamic site with Lando, Part 1</title>
      <dc:creator>Elanor</dc:creator>
      <pubDate>Fri, 05 Mar 2021 04:54:34 +0000</pubDate>
      <link>https://dev.to/oranges13/starting-up-a-new-statamic-site-with-lando-part-1-4kfi</link>
      <guid>https://dev.to/oranges13/starting-up-a-new-statamic-site-with-lando-part-1-4kfi</guid>
      <description>&lt;p&gt;&lt;span&gt;Photo by &lt;a href="https://unsplash.com/@lazycreekimages?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Michael Dziedzic&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/static?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Why Stamatic?
&lt;/h1&gt;

&lt;p&gt;I have been meaning to rework my website for several years, but other projects have always gotten in the way. I was waffling between a Laravel custom site, Wordpress, flat file sites, others.. you get the idea. That was also not helping with the spinning of wheels and getting nowhere.&lt;/p&gt;

&lt;p&gt;When Laravel News &lt;a href="https://laravel-news.com/why-did-you-choose-statamic" rel="noopener noreferrer"&gt;announced that they had updated their site to using Statamic 3&lt;/a&gt;, I looked into the platform in more depth. (They also have a really cool write-up from the team that helped migrate them from Wordpress to Statamic &lt;a href="https://zaengle.com/blog/laravel-news-website" rel="noopener noreferrer"&gt;here&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Please come along on the ride with me as I try to boot this thing up and rebuild my website with Stamatic.&lt;/p&gt;

&lt;h1&gt;
  
  
  Lando
&lt;/h1&gt;

&lt;p&gt;Another tool I had recently learned about is &lt;a href="https://lando.dev" rel="noopener noreferrer"&gt;Lando&lt;/a&gt;, which is a very simple Docker-based site configuration tool that makes spinning up new web development projects super easy. Docker makes everything easier to develop and release since it is all self contained, and Lando takes a lot of the initial overhead of Docker container setup out of the equation. It even handles the creation and management of HTTPS certs, so you can develop securely on your localhost right out of the box. I highly urge you to check it out.&lt;/p&gt;

&lt;h1&gt;
  
  
  Getting Started
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Install Lando
&lt;/h2&gt;

&lt;p&gt;Step 1 is to &lt;a href="https://docs.lando.dev/basics/installation.html#system-requirements" rel="noopener noreferrer"&gt;install Lando&lt;/a&gt; which varies depending on your operating system. On Linux, you can follow their &lt;a href="https://docs.lando.dev/basics/installation.html#linux" rel="noopener noreferrer"&gt;simple four step process&lt;/a&gt; which includes installing Docker Community Edition. The Windows installer includes Docker Desktop, as well.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;After you have installed, verify your installation by attempting to use the &lt;code&gt;lando version&lt;/code&gt; command -- which should print out the current version installed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Create your Lando + Statamic Project
&lt;/h2&gt;

&lt;p&gt;The beauty of Docker (and Lando) is that you don't have to have any of your dependencies installed on your local machine, you can use the containers to do everything for you. Lando makes this super simple. Without composer installed locally, we can install the Statamic installer and start up a new application folder with a few commands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;my-cool-project
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;my-cool-project
&lt;span class="nv"&gt;$ &lt;/span&gt;lando init &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;--source&lt;/span&gt; cwd &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;--recipe&lt;/span&gt; lamp &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;--webroot&lt;/span&gt; public &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;--name&lt;/span&gt; my-statamic-site
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will create the &lt;code&gt;.lando.yml&lt;/code&gt; file for you:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-statamic-site&lt;/span&gt;
&lt;span class="na"&gt;recipe&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;lamp&lt;/span&gt;
&lt;span class="na"&gt;config&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;webroot&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;public&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lando comes with several &lt;a href="https://docs.lando.dev/config/recipes.html" rel="noopener noreferrer"&gt;recipes&lt;/a&gt; out of the box, and LAMP, LEMP, or even the Laravel recipe will work (if you install Statamic's Laravel package). For this tutorial, I chose the LAMP stack.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configure Services (Optional)
&lt;/h3&gt;

&lt;p&gt;I did not configure much at this point, but before building your images and containers, now is a great time to check out the Lando documentation to see the &lt;a href="https://docs.lando.dev/config/services.html" rel="noopener noreferrer"&gt;additional services&lt;/a&gt; and configuration you can add to your project. Statamic doesn't require anything beyond the LAMP recipe's defaults.&lt;br&gt;
Each recipe has it's own &lt;a href="https://docs.lando.dev/config/recipes.html#config" rel="noopener noreferrer"&gt;available options&lt;/a&gt;, so make sure to read through the available configuration for the one you choose.&lt;/p&gt;
&lt;h2&gt;
  
  
  Install Statamic
&lt;/h2&gt;

&lt;p&gt;From the base Lando configuration, we can use the composer image to install Statamic (from your newly created project directory):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;lando ssh &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"composer global require statamic/cli &amp;amp;&amp;amp; statamic new placeholder"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;NOTE&lt;/em&gt; I was unable to figure out how to install statamic into the current directory, so we're installing it into &lt;code&gt;placeholder&lt;/code&gt; and then we'll move everything up to our root directory afterwards.&lt;/p&gt;

&lt;p&gt;After it's installed everything, move the project files up a directory (frustrating, but if you actually do want to keep this directory, you can just use that instead of the placeholder name -- just make sure to update your webroot in the &lt;code&gt;.lando.yml&lt;/code&gt; above):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;placeholder
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;mv&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt; .&lt;span class="k"&gt;*&lt;/span&gt; ..
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ..
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; placeholder
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Booting it up for first run!
&lt;/h2&gt;

&lt;p&gt;You now have Lando configured, which will take care of your technology stack, and you have installed Statamic which is the software we will be using to build the site!&lt;/p&gt;

&lt;p&gt;Let's turn it on! From our working directory, type the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;lando start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will build all the Docker containers and images and get everything up and running. At the end, Lando will provide URLs where you can access your new shiny website!&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;/ _ \/ _ `/  '_/ _ `/ / _ `/  '_/ _ `/_/_/_/ 
/____/\___/\___/_/_/_/___/_//_/\_,_/_/\_\\_,_/_/\_,_/_/\_\\_,_(_|_|_)  


Your app has started up correctly.
Here are some vitals:

 NAME                  statamic                             
 LOCATION              /home/&amp;lt;your_user&amp;gt;/workspace/statamic      
 SERVICES              appserver, database 
 APPSERVER_NGINX URLS  https://localhost:49155              
                       http://localhost:49156               
                       http://statamic.lndo.site/           
                       https://statamic.lndo.site/          
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now your new site is up and running with only a few commands!&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmd3y6k5irm62udn1np50.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmd3y6k5irm62udn1np50.png" alt="Your new site is up and running with only a few commands!"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create your admin user
&lt;/h2&gt;

&lt;p&gt;The final step is to make your super user and get started on the control panel. Make sure you choose &lt;code&gt;yes&lt;/code&gt; when asked if you want your user to be a super user!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;lando php please make:user

Email:
 &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; youremail@yourdomain.com

 Name &lt;span class="o"&gt;[]&lt;/span&gt;:
 &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; John Smith

 Password &lt;span class="o"&gt;(&lt;/span&gt;Your input will be hidden&lt;span class="o"&gt;)&lt;/span&gt;:
 &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 

 Super user &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;yes&lt;/span&gt;/no&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;no]:
 &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; y

User created successfully.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Wrap Up
&lt;/h1&gt;

&lt;p&gt;In this post, I went over how to install Lando to get a really quick LAMP or LEMP stack up and running and also installed Statamic! As I work more on building my new website, I will update with Part 2 -- which will include basic content creation and a little bit of tinkering with the layout and theme.&lt;/p&gt;

</description>
      <category>php</category>
      <category>lando</category>
      <category>docker</category>
      <category>statamic</category>
    </item>
    <item>
      <title>Testing DataTables JSON response in Laravel without using Dusk</title>
      <dc:creator>Elanor</dc:creator>
      <pubDate>Mon, 18 May 2020 19:48:28 +0000</pubDate>
      <link>https://dev.to/oranges13/testing-datatables-json-response-in-laravel-without-using-dusk-1d</link>
      <guid>https://dev.to/oranges13/testing-datatables-json-response-in-laravel-without-using-dusk-1d</guid>
      <description>&lt;p&gt;Recently, I needed to quickly test Datatables-as-a-service implementation but I didn't want to use Laravel Dusk for just one test. An easy workaround is to check that the JSON response contains the data that you're looking for. But because this is encoded I ran into a caveat with the random test data.&lt;/p&gt;

&lt;p&gt;For example, I was filtering the datatable so that administrator users can see all the entries, but normal users can only see their own entries. We expect the JSON response to only have the data related to the specific user viewing the results.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test That Users Can Only See Their Entries
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;testUserCanOnlySeeTheirEntries&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;factory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'App\User'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="c1"&gt;// Create one that belongs to me&lt;/span&gt;
    &lt;span class="nv"&gt;$user_entry&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;factory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'App\Entry'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;'user_id'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$user&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
    &lt;span class="c1"&gt;// Create one that is random&lt;/span&gt;
    &lt;span class="nv"&gt;$other&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;factory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'App\Entry'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;create&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="nf"&gt;actingAs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
       &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;getJson&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'entries.index'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'HTTP_X-Requested-With'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'XMLHttpRequest'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
       &lt;span class="c1"&gt;// See the users' results as expected&lt;/span&gt;
       &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;assertJsonFragment&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;'end'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$user_entry&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'m/d/Y h:i A'&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt;
       &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;assertSeeText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$user&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="c1"&gt;// Don't see results that do not belong to me&lt;/span&gt;
       &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;assertJsonMissing&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;'end'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$other&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'m/d/Y h:i A'&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt;
       &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;assertDontSeeText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$other&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This test worked great, until it didn't. If Faker happened to generate a user's name with special characters, like &lt;code&gt;Ellie O'Neil&lt;/code&gt; the test would fail due to encoding. &lt;code&gt;Ellie O'Neil could not be found in string: Ellie O&amp;amp;#039;Neil&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Technically the application was working fine -- since this data will be passed to the browser for display it doesn't matter if it's encoded or not. But we want our CI pipelines to succeed no matter what the randomly generated data might be.&lt;/p&gt;

&lt;p&gt;Quick fix for this is to use &lt;a href="https://www.php.net/manual/en/function.htmlspecialchars.php"&gt;htmlspecialchars&lt;/a&gt; to encode the search string so that it will match the JSON results no matter what.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Change&lt;/span&gt;
&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;assertSeeText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$user&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;// to&lt;/span&gt;
&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;assertSeeText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;htmlspecialchars&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$user&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;ENT_QUOTES&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure to use the ENT_QUOTES flag so that apostraphes are encoded as well as everything else.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>datatables</category>
      <category>service</category>
      <category>json</category>
    </item>
    <item>
      <title>PHPStorm + Xdebug + Alpine on Docker</title>
      <dc:creator>Elanor</dc:creator>
      <pubDate>Wed, 08 Apr 2020 16:50:46 +0000</pubDate>
      <link>https://dev.to/oranges13/phpstorm-xdebug-alpine-on-docker-13ff</link>
      <guid>https://dev.to/oranges13/phpstorm-xdebug-alpine-on-docker-13ff</guid>
      <description>&lt;p&gt;First, I wanted to thank &lt;a class="mentioned-user" href="https://dev.to/aschmelyun"&gt;@aschmelyun&lt;/a&gt; for his very informative series on Docker + Laravel for development. If you haven't checked out his posts on this topic, you absolutely should!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/aschmelyun/the-beauty-of-docker-for-local-laravel-development-13c0"&gt;Docker for Laravel Development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/aschmelyun/crafting-a-better-local-laravel-dev-environment-with-docker-45cj"&gt;Better local development for Laravel with Docker&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can also check out his &lt;a href="https://github.com/aschmelyun/docker-compose-laravel" rel="noopener noreferrer"&gt;git repository for this development strategy&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I've customized and integrated this method into my repos for local development and it's made starting up new projects a breeze.&lt;/p&gt;

&lt;p&gt;BUT, I recently worked through getting PHPStorm and Xdebug working with this docker setup, and it was a bit tricky. Here's what I did to make it work:&lt;/p&gt;

&lt;h2&gt;
  
  
  Add Xdebug to the Webserver &lt;code&gt;Dockerfile&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Since this image is using alpine, it's a little different than a lot of the approaches you might find if you just google "Install Xdebug PHP." At the end of your app &lt;code&gt;Dockerfile&lt;/code&gt; you need to manually install xdebug using pecl, so add this command at the bottom.&lt;/p&gt;

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

RUN apk add --no-cache $PHPIZE_DEPS \
    &amp;amp;&amp;amp; pecl install xdebug-2.7.0 \
    &amp;amp;&amp;amp; docker-php-ext-enable xdebug


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

&lt;/div&gt;

&lt;p&gt;This will download and enable xdebug (change the version to the one you want to use as needed, ensuring that it's compatible with the version of PHP you're using in your dockerfile).&lt;/p&gt;

&lt;h2&gt;
  
  
  Modify the nginx config to expose the ports
&lt;/h2&gt;

&lt;p&gt;In your &lt;code&gt;docker-compose.yml&lt;/code&gt; modify the nginx section to include the port for xdebug:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;

&lt;span class="na"&gt;webserver&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx:stable-alpine&lt;/span&gt;
    &lt;span class="na"&gt;container_name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${APP_NAME}-webserver&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;80:80"&lt;/span&gt;
      &lt;span class="c1"&gt;# Add the port for Xdebug here&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;9001:9001"&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;./:/var/www/html&lt;/span&gt;
      &lt;span class="c1"&gt;# Path to custom nginx config (yours may be different)&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;./docker-nginx.conf:/etc/nginx/conf.d/default.conf&lt;/span&gt;
    &lt;span class="na"&gt;depends_on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;app&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;db&lt;/span&gt;
    &lt;span class="na"&gt;networks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;laravel&lt;/span&gt;


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

&lt;/div&gt;
&lt;h2&gt;
  
  
  Add xdebug configuration to PHP's configuration
&lt;/h2&gt;

&lt;p&gt;You'll also need to create a new .ini file to include the xdebug configuration in your PHP config.&lt;/p&gt;

&lt;p&gt;Create a new .ini file in your project folder, wherever you want to put it. I called mine &lt;code&gt;docker-xdebug.ini&lt;/code&gt; and placed it in the root of my project. If you wanted to organize it into a different folder to keep things organized, you're welcome to do so. Just make sure to define the path correctly when you modify your &lt;code&gt;docker-compose.yml&lt;/code&gt; in the following steps:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;

&lt;span class="c"&gt;# File: docker-xdebug.ini
&lt;/span&gt;&lt;span class="py"&gt;zend_extension&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;xdebug.so&lt;/span&gt;
&lt;span class="py"&gt;xdebug.remote_enable&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;1&lt;/span&gt;
&lt;span class="py"&gt;xdebug.remote_autostart&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;1&lt;/span&gt;
&lt;span class="c"&gt;;xdebug.remote_handler=dbgp
#To activate XDEBUG remote host must be your local IP address.
#This is not Docker machine ip address, but the ones running Phpstorm
&lt;/span&gt;&lt;span class="py"&gt;xdebug.remote_host&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;host.docker.internal&lt;/span&gt;
&lt;span class="py"&gt;xdebug.remote_port&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;9001&lt;/span&gt;


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

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://docs.docker.com/docker-for-windows/networking/" rel="noopener noreferrer"&gt;On Windows&lt;/a&gt; &lt;code&gt;host.docker.internal&lt;/code&gt; will automatically resolve to your local IP address. You might need a different workaround on Linux or Mac. You can read more about this from &lt;a href="https://blog.jetbrains.com/phpstorm/2018/08/quickstart-with-docker-in-phpstorm/" rel="noopener noreferrer"&gt;Jetbrains&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now, make sure to include the new .ini file in your PHP configuration in the &lt;code&gt;docker-compose.yml&lt;/code&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;

&lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;context&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;.&lt;/span&gt;
      &lt;span class="na"&gt;dockerfile&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Dockerfile&lt;/span&gt;
    &lt;span class="na"&gt;container_name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${APP_NAME}-app&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;unless-stopped&lt;/span&gt;
    &lt;span class="na"&gt;tty&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;9000:9000"&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;./:/var/www/html&lt;/span&gt;
      &lt;span class="c1"&gt;# Xdebug Config for PHPStorm, check your local path to make sure it exists&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;./docker-xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini&lt;/span&gt;
    &lt;span class="na"&gt;networks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;laravel&lt;/span&gt;


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

&lt;/div&gt;
&lt;h2&gt;
  
  
  Setting up PHPStorm
&lt;/h2&gt;

&lt;p&gt;At this point you should be able to boot your images using the command line &lt;code&gt;docker-compose&lt;/code&gt; command or using PHP storm to build a run configuration. You can follow along &lt;a href="https://blog.jetbrains.com/phpstorm/2018/08/quickstart-with-docker-in-phpstorm/" rel="noopener noreferrer"&gt;with the Jetbrains blog post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Make sure to modify your Xdebug listening port to 9001 in your Preferences: &lt;code&gt;CTRL+ALT+S&lt;/code&gt; Languages &amp;amp; Frameworks | PHP | Debug:&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fv1r7u0dp4r8elmvt0li2.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fv1r7u0dp4r8elmvt0li2.PNG" alt="PHPStorm Xdebug make sure to change your port!"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the settings you can also check "Break at first line in PHP scripts" for now just to make sure your connection is working.&lt;/p&gt;
&lt;h2&gt;
  
  
  Debugging!
&lt;/h2&gt;

&lt;p&gt;If you have your application files available, you can now set a breakpoint in your code and visit &lt;a href="http://localhost" rel="noopener noreferrer"&gt;http://localhost&lt;/a&gt; to trigger the "break on first line of PHP" degug breakpoint. Otherwise, you can create a simple &lt;em&gt;HelloWorld.php&lt;/em&gt; file in your public directory and PHPStorm should pick up the breakpoint and display the debugging information in your IDE window.&lt;/p&gt;

&lt;p&gt;Make sure you enable listening in PHPStorm to start the debugger:&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftcm6izz7803ivzb8gfp8.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftcm6izz7803ivzb8gfp8.PNG" alt="Listen for Debugging Connections"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;

&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;

&lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Hello World!"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;



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

&lt;/div&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fi4e8unyvkumzldhclmf8.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fi4e8unyvkumzldhclmf8.PNG" alt="Debugging Successful!"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hopefully, this helps someone else get PHPStorm + Docker working together!&lt;/p&gt;

</description>
      <category>docker</category>
      <category>alpine</category>
      <category>xdebug</category>
      <category>php</category>
    </item>
    <item>
      <title>Bitbucket Pipelines + Laravel + PHPUnit</title>
      <dc:creator>Elanor</dc:creator>
      <pubDate>Thu, 27 Feb 2020 21:01:55 +0000</pubDate>
      <link>https://dev.to/oranges13/bitbucket-pipelines-laravel-phpunit-16lj</link>
      <guid>https://dev.to/oranges13/bitbucket-pipelines-laravel-phpunit-16lj</guid>
      <description>&lt;p&gt;I recently decided to enable pipelines in a relatively simple repository to see if I could automate my PHPUnit tests. There's &lt;a href="https://www.google.com/search?q=bitbucket+pipeline+laravel" rel="noopener noreferrer"&gt;lots of other articles&lt;/a&gt; online about getting this to work for laravel, but my application had a few unique requirements beyond the standard Laravel packages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;LDAP for authentication with Active Directory&lt;/li&gt;
&lt;li&gt;GD Image manipulation library for use with &lt;a href="http://image.intervention.io/" rel="noopener noreferrer"&gt;intervention\image&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;I wanted to use SQLite in-memory database for my tests&lt;/li&gt;
&lt;li&gt;I did not want to commit a "pipeline" environment file, instead using the phpunit.xml file included with Laravel&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Setting up Bitbucket Pipelines
&lt;/h1&gt;

&lt;p&gt;The first step is enabling pipelines for your repository. Bitbucket cloud comes with 50 minutes per month for free, so almost everyone can utilize this service without having to pay for an account.&lt;/p&gt;

&lt;p&gt;Within your repo, you need to click on "Settings" then scroll down to &lt;em&gt;Pipelines&lt;/em&gt; -&amp;gt; &lt;em&gt;Settings&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You'll be greeted with a slider to enable pipelines for your repository.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fceq5unnm4gs1ds7mthpc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fceq5unnm4gs1ds7mthpc.png" alt="Enable Pipelines for your repository"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Choosing a Base Image
&lt;/h2&gt;

&lt;p&gt;Once you've done that, you will need to create a &lt;code&gt;bitbucket-pipelines.yml&lt;/code&gt; file. Bitbucket helpfully provides a default PHP configuration, but we need to modify it to work for us. Bitbucket uses &lt;a href="https://docker.io" rel="noopener noreferrer"&gt;Docker&lt;/a&gt; to load pre-configured images and you can customize them using this file. Dockerhub is a great repository to find the perfect base image for your pipeline!&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzusac1y7fiex6mxz33y3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzusac1y7fiex6mxz33y3.png" alt="Dockerhub is a great repository to find the perfect base image for your pipeline"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Bitbucket will automatically handle downloading your repo and linking it into the Docker image, but you will need to include any additional requirements for your specific project. Many tutorials suggest starting with a PHP base image. This is a great starting point and allows you to customize all your requirements from the bottom up.&lt;/p&gt;

&lt;p&gt;For example, you could choose to start with one of the official php Docker images, in my case I wanted at least PHP 7.2.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;

&lt;span class="c1"&gt;# Start your bitbucket-pipelines.yml file with your base image&lt;/span&gt;
&lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;php:7.2-fpm&lt;/span&gt;


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

&lt;/div&gt;

&lt;p&gt;The major &lt;em&gt;downside&lt;/em&gt; to this approach, is that you have to install and enable all your dependencies from scratch. This also means your pipeline will take longer to complete each time it runs. For the free bitbucket plan, this means you'd be using up more of your free minutes! For my use case, I wanted to pre-load as many dependencies if possible, so finding a Laravel-specific base image was imperative.&lt;/p&gt;

&lt;p&gt;After reading several tutorials, I stumbled across &lt;a href="https://lorisleiva.com/using-gitlabs-pipeline-with-laravel/" rel="noopener noreferrer"&gt;this git-lab specific tutorial for Laravel&lt;/a&gt; by Loris Leiva, which included their &lt;a href="https://hub.docker.com/r/lorisleiva/laravel-docker" rel="noopener noreferrer"&gt;customized laravel Docker image&lt;/a&gt;. This whittled down the additional packages that I would need to install to just a few, rather than all the Laravel-specific dependencies.&lt;/p&gt;

&lt;h1&gt;
  
  
  Writing the &lt;code&gt;bitbucket-pipelines.yml&lt;/code&gt; file
&lt;/h1&gt;

&lt;p&gt;Loris's image is based on alpine linux, so we can easily install the few dependencies needed for our specific Laravel app within the &lt;code&gt;bitbucket-pipelines.yml&lt;/code&gt; file as follows:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;

&lt;span class="c1"&gt;# Load the Laravel image for PHP 7.2&lt;/span&gt;
&lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;lorisleiva/laravel-docker:7.2&lt;/span&gt;

&lt;span class="na"&gt;pipelines&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;step&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="c1"&gt;# Name your step, in my case I'm running tests&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Test&lt;/span&gt;

        &lt;span class="c1"&gt;# Cache composer dependencies to speed building between runs&lt;/span&gt;
        &lt;span class="na"&gt;caches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;composer&lt;/span&gt;

        &lt;span class="c1"&gt;# This is the heavy lifting portion where we install our dependencies&lt;/span&gt;
        &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="c1"&gt;# I need to install sqlite for in-memory testing, ldap, and libpng for gd compatability&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;apk --no-cache add php7-ldap php7-sqlite3 sqlite sqlite-dev&lt;/span&gt;
              &lt;span class="s"&gt;libpng libpng-dev libldap openldap-dev&lt;/span&gt;

          &lt;span class="c1"&gt;# Enable the PHP extensions for the previously installed dependencies&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;docker-php-ext-install ldap pdo pdo_sqlite gd&lt;/span&gt;

          &lt;span class="c1"&gt;# Install composer dependencies&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts&lt;/span&gt;

          &lt;span class="c1"&gt;# Run our tests!&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;phpunit --coverage-text --colors=never --verbose&lt;/span&gt;        


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

&lt;/div&gt;

&lt;p&gt;If there's a dependency for Alpine linux you need, and you're not sure how to find it, the &lt;a href="https://pkgs.alpinelinux.org/packages" rel="noopener noreferrer"&gt;Alpine Linux packages&lt;/a&gt; reference is a great way to find what you need! Of course, don't be surprised if you have to update your build file a few times to figure out everything exactly.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Foj9z6efzyne2l14o6uab.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Foj9z6efzyne2l14o6uab.png" alt="Failure, then success!"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Viewing your results
&lt;/h1&gt;

&lt;p&gt;Once you have committed your &lt;code&gt;bitbucket-pipelines.yml&lt;/code&gt; file, you can view the results of your builds by clicking on &lt;em&gt;Pipelines&lt;/em&gt; in the sidebar of the Bitbucket repo interface.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fetgej42cira09n29rng4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fetgej42cira09n29rng4.png" alt="View Pipeline results"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you click on one of the &lt;em&gt;success&lt;/em&gt; or &lt;em&gt;failed&lt;/em&gt; lines, you can deep dive into the console to figure out what went wrong.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6c6w0k3d7i8rmehgj3ce.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6c6w0k3d7i8rmehgj3ce.png" alt="This build failed because I did not install the right package for ldap to install correctly."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In my case, I had to add &lt;code&gt;libldap&lt;/code&gt; to the &lt;code&gt;apk add&lt;/code&gt; command for the php extension to be enabled successfully.&lt;/p&gt;

&lt;h1&gt;
  
  
  Further reading
&lt;/h1&gt;

&lt;p&gt;There's a lot more that you can do with Bitbucket Pipelines, and I would encourage you to read the Bitbucket wiki and documentation regarding all the different options.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://confluence.atlassian.com/bitbucket/get-started-with-bitbucket-pipelines-792298921.html" rel="noopener noreferrer"&gt;Getting started with Bitbucket Pipelines&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://confluence.atlassian.com/bitbucket/laravel-with-bitbucket-pipelines-913473967.html" rel="noopener noreferrer"&gt;Laravel and Pipelines&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://confluence.atlassian.com/bitbucket/caching-dependencies-895552876.html" rel="noopener noreferrer"&gt;Caching&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://confluence.atlassian.com/bitbucket/using-artifacts-in-steps-935389074.html" rel="noopener noreferrer"&gt;Artifacts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

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