<?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: Nikolay Tsanov</title>
    <description>The latest articles on DEV Community by Nikolay Tsanov (@ntsanov).</description>
    <link>https://dev.to/ntsanov</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%2F390819%2Fb1738e83-c1ef-4396-a1fe-430bd92f7ecc.jpg</url>
      <title>DEV Community: Nikolay Tsanov</title>
      <link>https://dev.to/ntsanov</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ntsanov"/>
    <language>en</language>
    <item>
      <title>Nested Request Throttling in Laravel</title>
      <dc:creator>Nikolay Tsanov</dc:creator>
      <pubDate>Wed, 06 Jan 2021 09:13:39 +0000</pubDate>
      <link>https://dev.to/ntsanov/nested-request-throttling-in-laravel-392d</link>
      <guid>https://dev.to/ntsanov/nested-request-throttling-in-laravel-392d</guid>
      <description>&lt;p&gt;Let me set the stage first: You have a globally assigned throttle middleware on a specific route group or maybe even assigned directly inside the &lt;code&gt;RouteServiceProvider&lt;/code&gt; on all routes from a specific file. Then, you try to assign (nest) the throttle middleware inside that group onto a specific route expecting that the global throttle values will be overwritten by the nested values just to be surprised that the route gets locked after fewer requests than specified (more specifically, in the case of a single nested throttle middleware - two times fewer requests than expected).&lt;/p&gt;

&lt;p&gt;I found myself in this scenario and after giving some thought it does make sense - the middleware is called twice so two hits rather than one. (The &lt;code&gt;X-RateLimit-Remaining&lt;/code&gt; header gets decremented by two rather than one) However, how can we overcome this obstacle?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We can remove the global throttle middleware and just apply it on all routes we need it. (Quite a bit of repeating indeed)&lt;/li&gt;
&lt;li&gt;Perhaps, we can extend the default throttle middleware and implement some kind of an identifier that we’ll use to differentiate the throttles.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Luckily, Laravel already has a &lt;a href="https://github.com/laravel/framework/pull/28856"&gt;solution&lt;/a&gt; for us! It uses the second approach to prefix the various throttles so that we can use them independently. Unfortunately, the documentation doesn’t mention this, however, it is pretty straightforward.&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;// User can send 1000 requests of any kind in an hour.&lt;/span&gt;
&lt;span class="nc"&gt;Route&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;prefix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'image'&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;middleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'auth'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'throttle:1000,60'&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;group&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// User can download 10 times a minute.&lt;/span&gt;
    &lt;span class="nc"&gt;Route&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/download'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'ImageController@download'&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;middleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'throttle:10,1,minute_download'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// User can search 100 times an hour&lt;/span&gt;
    &lt;span class="nc"&gt;Route&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/search'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'ImageController@search'&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;middleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'throttle:100,60,search'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// Use default throttle, user can send 1000 images in an hour.&lt;/span&gt;
    &lt;span class="nc"&gt;Route&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/send'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'ImageController@send'&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;The route group above wraps three routes inside the &lt;code&gt;auth&lt;/code&gt; and &lt;code&gt;throttle&lt;/code&gt; middlewares. These two middlewares can be considered as global to the routes within that group. Depending on the scenario, we might consider applying different throttle values for some of the routes in the group. This is the case with the &lt;code&gt;/download&lt;/code&gt; and &lt;code&gt;/search&lt;/code&gt; routes - we want to have a lower request limit for them (in the current case). We achieve this by passing a third argument to the throttle middleware. This is the prefix value that will be used to differentiate them - &lt;code&gt;throttle:max_requests,period,prefix&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This feature has been introduced in Laravel 6.0. For any previous versions, you need to extend the default throttle and implement your own solution.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Originally posted on &lt;a href="https://ntsanov.com/blog/nested-request-throttling-in-laravel"&gt;https://ntsanov.com/blog/nested-request-throttling-in-laravel&lt;/a&gt;&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
    </item>
    <item>
      <title>PhpStorm, But Better! #2 - Making It Look Pretty</title>
      <dc:creator>Nikolay Tsanov</dc:creator>
      <pubDate>Wed, 29 Jul 2020 21:00:00 +0000</pubDate>
      <link>https://dev.to/ntsanov/phpstorm-but-better-2-making-it-look-pretty-7ik</link>
      <guid>https://dev.to/ntsanov/phpstorm-but-better-2-making-it-look-pretty-7ik</guid>
      <description>&lt;p&gt;This is an archive of the second email from the series - &lt;a href="http://phpstormbutbetter.com/"&gt;“PhpStorm, But Better!”&lt;/a&gt;. In the emails, I’m sharing thoughts, news and more about PhpStorm, so make sure you’re not missing anything by signing up for the newsletter!&lt;/p&gt;

&lt;p&gt;Today, we’ll explore one of the most interesting topics for me - &lt;strong&gt;making the IDE look good&lt;/strong&gt;. As I mentioned in the last email, having a good theme and font is essential. You’ll be staring many hours at that exact screen, so you need to take your time and make it look appealing. However, it’s not only for you to look fancy in front of colleagues, but you also need a theme that will suit your environment and a font that is easy to read. For example, if you are in a bright environment, you need a light theme that will help you relax your eyes. If you are working late and it’s dark, you might prefer a dark theme. When switching from dark to light, or the other way around, it takes some getting used to, however, always consider it as a fresh start which might even motivate you to write more code!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note: This is a controversial topic, all of the information given here is just suggestions that you might or might not follow. Everything is up to you!&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of contents
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Topic I - Aestetics
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;del&gt;Removing the Panels and Floating Tools&lt;/del&gt;&lt;/li&gt;
&lt;li&gt;&lt;del&gt;Moving The Sidebar (Projects Explorer)&lt;/del&gt;&lt;/li&gt;
&lt;li&gt;Picking Up A Theme&lt;/li&gt;
&lt;li&gt;Picking Up Font&lt;/li&gt;
&lt;li&gt;Better Icons&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Picking Up A Theme
&lt;/h2&gt;

&lt;p&gt;We’ll start with deciding on a theme. I’ll first give you few suggestions for a light theme and the reasons behind using one. Then, the same procedure for a dark theme. Lastly, I’ll finish off with a suggestion for a theme that is in between dark and light.&lt;/p&gt;

&lt;h3&gt;
  
  
  Light Theme
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1Gz3uISJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/0.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1Gz3uISJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/0.jpg" alt="" width="616" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, leaving jokes aside, there are many benefits for using a light theme and there are some misunderstandings about it. You can check Brent Roose’s video on this topic. He explains the difference between contrast and brightness, colours, visual patterns and much more. I’ll summerise some of the information related to the themes.&lt;/p&gt;

&lt;p&gt;Many people prefer dark themes invoking the reason that light themes hurt their eyes. However, this is simply not true. Brightness is what hurts your eyes, not the contrast of the theme. Many studies have shown that having dark text on a light background is much easier to read than having the opposite (especially for prolonged periods).&lt;/p&gt;

&lt;p&gt;Introducing to you, &lt;a href="https://github.com/brendt/phpstorm-photon-theme"&gt;Photon&lt;/a&gt; colour scheme for PhpStorm by none other than Brent himself. It is a high contrast scheme based on the colour palette of Firefox’s dev tools.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9l80d4ht--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9l80d4ht--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/1.png" alt="Photon" width="800" height="510"&gt;&lt;/a&gt;&lt;p&gt;Photon&lt;/p&gt;

&lt;/p&gt;

&lt;p&gt;The easiest way to import the colour scheme is by opening your preferences dialog ( &lt;strong&gt;macOS: PhpStorm &amp;gt; Preferences…&lt;/strong&gt; or &lt;strong&gt;Windows, Linux: File &amp;gt; Settings&lt;/strong&gt; ), then &lt;strong&gt;Editor &amp;gt; Color Scheme &amp;gt; Import Scheme…&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xnbS4RIo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xnbS4RIo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/2.png" alt="" width="800" height="284"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you prefer to do all of this manually, download the &lt;strong&gt;.icls&lt;/strong&gt; files from the repository and place them inside your PhpStorm preferences directory. The location depends on the OS and the version of PhpStorm. You can check more on their website. For version 2020.1 and above (I assume you are on the latest one), you can do this (where &lt;code&gt;&amp;lt;product&amp;gt;&lt;/code&gt; is PhpStorm):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Windows: &lt;code&gt;%APPDATA%\JetBrains\&amp;lt;product&amp;gt;&amp;lt;version&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;macOS: &lt;code&gt;~/Library/Application Support/JetBrains/&amp;lt;product&amp;gt;&amp;lt;version&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Linux: &lt;code&gt;~/.config/JetBrains/&amp;lt;product&amp;gt;&amp;lt;version&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Inside the directory, you’ll need to place your &lt;strong&gt;.icls&lt;/strong&gt; files in the &lt;strong&gt;/colors&lt;/strong&gt; folder (if you don’t have it, just create it).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dt6zSqbE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dt6zSqbE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/3.png" alt="" width="800" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, restart PhpStorm, open your preferences dialog ( &lt;strong&gt;macOS: PhpStorm &amp;gt; Preferences…&lt;/strong&gt; or &lt;strong&gt;Windows, Linux: File &amp;gt; Settings&lt;/strong&gt; ), from there &lt;strong&gt;Editor &amp;gt; Color Scheme and select the Photon - Light scheme&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X96HMpnE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X96HMpnE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/4.png" alt="" width="800" height="602"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are switching from a dark scheme to a light one, or the other way around, PhpStorm will ask whether you want the theme to also be changed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IQZIVdTh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IQZIVdTh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/5.png" alt="" width="800" height="374"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, there is a difference between a scheme and a theme in PhpStorm. This is intuitive, however, I’ll still mention it. The scheme is considered to be the syntax highlighting, while the theme is simply the colour of the dialogs, panels etc. So it goes without saying, having them match is better looking than having a huge contrast, though, you are free to experiment!&lt;/p&gt;

&lt;p&gt;If you are not a fan of the colours of the previous colour scheme, you can check &lt;a href="https://github.com/brendt/phpstorm-light-lite-theme"&gt;Light Lite&lt;/a&gt;. I often find myself switching between those two. Light Lite is again made by Brent and it’s based on the colours of Google’s logo. You might have seen it already on some of &lt;a href="https://twitter.com/freekmurze"&gt;Freek&lt;/a&gt;’s streams or his feed when posting a screenshot of a snippet.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qWI6SSX3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qWI6SSX3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/6.png" alt="Light Lite" width="800" height="510"&gt;&lt;/a&gt;&lt;p&gt;Light Lite&lt;/p&gt;

&lt;/p&gt;

&lt;h3&gt;
  
  
  Dark Theme
&lt;/h3&gt;

&lt;p&gt;If you are still not convinced about trying a light theme, I got you! I do use dark themes as well, especially when I’m working late on a dim light. I find it easier to write code on a dark background when it’s dark around me (personal preference). I won’t be talking too much about the popular &lt;a href="https://plugins.jetbrains.com/plugin/8006-material-theme-ui"&gt;Material Theme UI&lt;/a&gt; that probably you’ve seen more than once. If you want to find more on how to set it up, I advise you to check Christoph’s &lt;a href="https://www.youtube.com/watch?v=3SUtEnMj1ws"&gt;video&lt;/a&gt; on it. My go-to dark theme, at the moment of writing, is &lt;a href="https://plugins.jetbrains.com/plugin/12275-dracula-theme"&gt;Dracula&lt;/a&gt; + Material Theme UI.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8wMeKp1c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8wMeKp1c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/7.png" alt="" width="800" height="510"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Just download the plugin and restart PhpStorm. After the restart, the plugin will be enabled, then you can do the trick I’ve shown you last time - &lt;strong&gt;Navigate &amp;gt; Search Everywhere &amp;gt; type “dracula”&lt;/strong&gt; and toggle it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7O9I12lY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7O9I12lY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/8.png" alt="" width="800" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Something In Between (Kinda)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FtCMDUmC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FtCMDUmC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/9.png" alt="Material Solarized Light" width="800" height="510"&gt;&lt;/a&gt;&lt;p&gt;Material Solarized Light&lt;/p&gt;

&lt;/p&gt;

&lt;p&gt;If you don’t want a dark theme, but you also find the light themes a bit too light, then this material theme + solarized light colour scheme is just for you.&lt;/p&gt;

&lt;p&gt;If you followed the steps from above and you already have the Material Theme UI enabled, then you are pretty much set. Just search for &lt;strong&gt;“solarized light”&lt;/strong&gt; in the &lt;strong&gt;“Search everywhere…“&lt;/strong&gt; dialog and toggle it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Picking Up Font
&lt;/h2&gt;

&lt;p&gt;Picking up font is the second most important thing after getting a nice theme on. I’ll stick to the free fonts since not everyone is willing to pay for a premium and I’m one of those people - I easily get bored with fonts, and I tend to switch them from time to time. Paying any amount of money for a font that I might change in a month is not ideal.&lt;/p&gt;

&lt;p&gt;Now, with the pricing out of the way, &lt;strong&gt;legibility&lt;/strong&gt; is the most important thing! There was a trend recently where using a font with italic styling was the mainstream, and yes, while it looks nice, there is a reason why monospace fonts are better for programmers. The programmer needs to easily distinguish each letter - one extra symbol can break everything. You’ll probably know the fonts that I’ll mention, but that goes without saying that they are top in this niche.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;​&lt;a href="https://github.com/tonsky/FiraCode"&gt;Fira Code (Retina)&lt;/a&gt; - Yes, you’ve probably seen it countless times and you might be even bored from it, however, this front stands out for its premium look which you get for free! Just head to the &lt;a href="https://github.com/tonsky/FiraCode"&gt;repository&lt;/a&gt; and try it out!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZwdBEo3w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/10.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZwdBEo3w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/10.png" alt="" width="800" height="1133"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;​&lt;a href="https://www.jetbrains.com/lp/mono/"&gt;Jetbrains Mono&lt;/a&gt; - This font is my second top pick. It’s clean, it stands out and it is a really good alternative to Fira Code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9FJhq5wF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/11.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9FJhq5wF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/11.png" alt="" width="800" height="1124"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, the difference is almost unnoticeable, but trust me you’ll see it! To set up the font, go to the &lt;strong&gt;PhpStorm’s preferences &amp;gt; Editor &amp;gt; Font&lt;/strong&gt;. I like having enough space between the lines, so I always go for something higher such as 2.0. On my screen, 14px font size looks perfect, so I’m keeping it like that. You can play around and see what suits you the best!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Q8_AdAB1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/12.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Q8_AdAB1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/12.png" alt="" width="800" height="714"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some people love font ligatures, some don’t. That’s up to you again! You can enable them with selecting the “Enable font ligatures” checkbox. You’ll get these nice-looking symbols for !=, ==, === etc. Setting up a fallback font is also a good practice, however, if you are using Fira Code, pretty much everything is supported.&lt;/p&gt;

&lt;h2&gt;
  
  
  Better Icons
&lt;/h2&gt;

&lt;p&gt;We’ll need to show some love to the sidebar. Even if you are not using it that much, you’ll still have to toggle it at one point. The default icons are a bit too bland for my taste.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--227hnTbH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/13.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--227hnTbH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/13.png" alt="Sidebar Before 'Better Icons'" width="790" height="1376"&gt;&lt;/a&gt;&lt;p&gt;Sidebar Before ‘Better Icons’&lt;/p&gt;

&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--THJoP_Ar--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/14.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--THJoP_Ar--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/14.png" alt="Sidebar After 'Better Icons'" width="788" height="1346"&gt;&lt;/a&gt;&lt;p&gt;Sidebar After ‘Better Icons’&lt;/p&gt;

&lt;/p&gt;

&lt;p&gt;To achieve this, head to the plugins’ marketplace and get the &lt;a href="https://plugins.jetbrains.com/plugin/10044-atom-material-icons"&gt;Atom Material Icons&lt;/a&gt;. Install it (just like you did with the Material UI plugin), enable it, and everything will be set for you out of the box.&lt;/p&gt;

&lt;p&gt;Now, we are pretty much done with our layout. We’ve organized the panels, we’ve picked up a theme and font, and we also have nice looking icons! However, as mentioned by &lt;a href="https://twitter.com/iksaku2"&gt;Jorge González&lt;/a&gt; on Twitter, after reorganizing the various aspects of the layout (especially placing the sidebar on the right), we need to store it as default, otherwise, when creating a new project your panels might look out of place. To do that, simply select &lt;strong&gt;Window &amp;gt; Store Current Layout as Default&lt;/strong&gt; or &lt;strong&gt;Navigate &amp;gt; Search Everywhere &amp;gt; type “store current layout as default”&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3WG0mXU_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/15.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3WG0mXU_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/15.png" alt="" width="530" height="274"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GWpCdnFn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/16.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GWpCdnFn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-making-it-look-pretty/16.png" alt="" width="800" height="172"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  News
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;PhpStorm 2020.2 has been released! Check out more on their &lt;a href="https://www.jetbrains.com/phpstorm/whatsnew/"&gt;website&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://alexvanderbist.com/"&gt;Alex Vanderbist&lt;/a&gt; added a nice live template for quickly writing PHP arrow functions. Check out the gist he posted (we’ll be exploring live templates later in the series).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Thank you once more for the great feedback!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you want to contribute to the newsletter, don’t hesitate to contact me either on &lt;a href="https://twitter.com/NikolayTsanov"&gt;Twitter&lt;/a&gt; or via email!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next time, we’ll explore plugins for PhpStorm that will make a huge difference in your daily workflow and more!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/blog/phpstorm-but-better-getting-rid-of-the-distractions"&gt;Getting Rid Of The Distractions&lt;/a&gt;&lt;/p&gt;

</description>
      <category>phpstorm</category>
      <category>tools</category>
      <category>php</category>
    </item>
    <item>
      <title>PhpStorm, But Better! #1 - Getting Rid Of The Distractions</title>
      <dc:creator>Nikolay Tsanov</dc:creator>
      <pubDate>Thu, 09 Jul 2020 21:00:00 +0000</pubDate>
      <link>https://dev.to/ntsanov/phpstorm-but-better-1-getting-rid-of-the-distractions-51ki</link>
      <guid>https://dev.to/ntsanov/phpstorm-but-better-1-getting-rid-of-the-distractions-51ki</guid>
      <description>&lt;p&gt;&lt;strong&gt;This is an archive of the first email from the series - &lt;a href="http://phpstormbutbetter.com/"&gt;“PhpStorm, But Better!”&lt;/a&gt;. In the emails, I’m sharing thoughts, news and more about PhpStorm, so make sure you’re not missing anything by signing up for the newsletter! Also, I'll be mainly posting on my &lt;a href="https://ntsanov.com/blog/"&gt;website&lt;/a&gt; so check that up as well!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I plan to help you improve your PhpStorm workflow by synthesizing useful resources, news, plugins and much more. Over time, your use of the IDE will drastically change and your performance will be significantly improved.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JVrVW1Ot--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-getting-rid-of-the-distractions/0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JVrVW1Ot--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-getting-rid-of-the-distractions/0.png" alt="" width="800" height="510"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before I start, I want to present you with a few principles that I enforce when working with the IDE (If you follow Caleb’s amazing newsletter about working with VS Code (&lt;a href="https://makevscodeawesome.com/"&gt;www.makevscodeawesome.com&lt;/a&gt;), you might be aware of some of them):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fewer distractions on the screen, more productive workflow.&lt;/li&gt;
&lt;li&gt;The theme and font are important! (I cannot stress this enough! You’re going to be staring at the IDE for hours, you must make it easy on your eyes and brain!)Shortcodes, shortcodes and more shortcodes! (If you can automate some actions, you should do it. There are many services that we, as developers, use that automate tedious tasks, we should do the same for our IDE).&lt;/li&gt;
&lt;li&gt;Don’t rely on your IDE blindly! (You’ll find out what I mean at a later point).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are the core principles I follow when working with a specific IDE. If you don’t agree with them, that is perfectly fine! Consider this newsletter as an alternative point of view that might be helpful to you as well! The good thing about it, you can apply most of the information here to other JetBrains’s products - Intellij IDEA, WebStorm, PyCharm and more (you can find a list of their products on their &lt;a href="https://www.jetbrains.com/products.html"&gt;website&lt;/a&gt;). The beauty of the JetBrain’s ecosystem is that their products are consistent, most of the settings are shared between them, so you can easily find your way. I’m not sponsored to say all of this, just my opinion!&lt;/p&gt;

&lt;p&gt;For students and teachers, you can get access to PhpStorm for free! More information can be found on JetBrains’ website - or a simple Google search will do the trick as well. However, the purpose of these free licenses is for education only. If you are planning on using it on a commercial project, you’ll have to purchase an individual license.&lt;/p&gt;

&lt;p&gt;Side note, I cannot express how thankful I am to the amazing PHP community! I’ll try to be as much transparent as possible about the newsletter by sharing statistics that might be helpful for those of you that want to start something similar. You can follow me on Twitter (&lt;a href="https://twitter.com/NikolayTsanov"&gt;@NikolayTsanov&lt;/a&gt;) for more of the insights.&lt;/p&gt;

&lt;p&gt;Without further ado let’s start with the first topic of the newsletter - getting rid of the distractions and styling your IDE (not only for you to look cool in front of your colleagues, but also important for your productivity).&lt;/p&gt;

&lt;p&gt;Note: for windows users, some of the shortcodes that I’ll reference might be a bit different - when I mention the &lt;strong&gt;Cmd&lt;/strong&gt; key, you need to replace it with &lt;strong&gt;Ctrl&lt;/strong&gt;. (More on the keymaps between PC and macOS can be found on the Microsoft’s &lt;a href="https://support.microsoft.com/en-us/help/970299/keyboard-mappings-using-a-pc-keyboard-on-a-macintosh"&gt;website&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of contents
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Topic I - Aestetics&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Removing the Panels and Floating Tools&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Moving the Sidebar (Projects Explorer)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Picking up a Theme (determine the best theme based on your surrounding)&lt;/li&gt;
&lt;li&gt;Picking up a Font (determine the best font for readability)&lt;/li&gt;
&lt;li&gt;Better Icons&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Removing the Panels and Floating Tools
&lt;/h2&gt;

&lt;p&gt;As I mentioned a few times already, panels are distractions. Hiding them will be more beneficial to you. If you need them, you can always toggle or assign a shortcode for easy access. In PhpStorm, there are plenty of them, most of which you’ll probably never use. This is what you’ll most probably have at the beginning:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FkAmNexQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-getting-rid-of-the-distractions/1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FkAmNexQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-getting-rid-of-the-distractions/1.png" alt="" width="800" height="477"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, your attention is “hijacked” by the information spilt on your screen. We’ll start off by removing the bars (Navigation Bar and Status Bar). Easiest way to do so is by going &lt;strong&gt;View &amp;gt; Appearance &amp;gt; Status Bar&lt;/strong&gt;. All of these options are available by also doing &lt;strong&gt;Navigate &amp;gt; Search Everywhere &amp;gt; type “status bar” &amp;gt; Show Status Bar (to off)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PRI70PAr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-getting-rid-of-the-distractions/2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PRI70PAr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-getting-rid-of-the-distractions/2.png" alt="" width="501" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Great! Now that we have the Status Bar removed, we can also get rid of the Tool Window Bars ( &lt;strong&gt;View &amp;gt; Appearance &amp;gt; Tool Window Bar&lt;/strong&gt; or &lt;strong&gt;Navigate &amp;gt; Search Everywhere &amp;gt; type “tool window bar” &amp;gt; Hide Tool Window Bar (to on)&lt;/strong&gt;).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--o2vXHrsK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-getting-rid-of-the-distractions/3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--o2vXHrsK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-getting-rid-of-the-distractions/3.png" alt="" width="495" height="434"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It already looks way better than before. However, there are still two panels left. By doing &lt;strong&gt;View &amp;gt; Appearance &amp;gt; Navigation Bar&lt;/strong&gt; or &lt;strong&gt;Navigate &amp;gt; Search Everywhere &amp;gt; type “navigation bar” &amp;gt; Show Navigation Bar (to off)&lt;/strong&gt; we get rid of a huge portion of the taken space.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mkNjau8o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-getting-rid-of-the-distractions/4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mkNjau8o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-getting-rid-of-the-distractions/4.png" alt="" width="516" height="438"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, we are left with the floating browsers. Let’s be honest, probably nobody uses them that often.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kUeWSOX9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-getting-rid-of-the-distractions/5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kUeWSOX9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-getting-rid-of-the-distractions/5.png" alt="" width="356" height="152"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;They can be removed simply by going to the PhpStorm’s settings and deselecting them. &lt;strong&gt;PhpStorm &amp;gt; Preferences &amp;gt; Tools &amp;gt; Web Browsers&lt;/strong&gt; , alternatively &lt;strong&gt;File &amp;gt; Settings &amp;gt; Tools &amp;gt; Web Browsers (on Windows and Linux)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eGo_hxgt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-getting-rid-of-the-distractions/6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eGo_hxgt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-getting-rid-of-the-distractions/6.png" alt="" width="800" height="610"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We finally end up with a clean and distraction-free IDE.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yf3AfNWV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-getting-rid-of-the-distractions/7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yf3AfNWV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-getting-rid-of-the-distractions/7.png" alt="" width="800" height="477"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Although, there is still a bit more left. On the bottom part of the window you can see the breadcrumbs. They are considered helpful by many, however, I personally never look at them (so I tend to hide them). It is your decision to make, to hide them you can just do &lt;strong&gt;Navigate &amp;gt; Search Everywhere &amp;gt; type “breadcrumbs” &amp;gt; Show Breadcrumbs (to off)&lt;/strong&gt; or &lt;strong&gt;PhpStorm &amp;gt; Preferences &amp;gt; Editor &amp;gt; General &amp;gt; Breadcrumbs &amp;gt; Show breadcrumbs (on macOS)&lt;/strong&gt;, alternatively &lt;strong&gt;File &amp;gt; Settings &amp;gt; Editor &amp;gt; General &amp;gt; Breadcrumbs &amp;gt; Show breadcrumbs (on Windows and Linux)&lt;/strong&gt;. In the settings, you can see that you have the option where to place them (top or bottom) and for which languages to show them. Completely up to you!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---gpmn9TH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-getting-rid-of-the-distractions/8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---gpmn9TH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-getting-rid-of-the-distractions/8.png" alt="" width="800" height="610"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you might ask yourself, “Why didn’t he hide the tabs?”. I enjoy using the tabs, there are some tricks that we’ll explore later in the series on how to limit the number of them and how to easily switch left and right using the keyboard. When working on multiple files, I find myself switching often between them (even with split screen). Using less brainpower to remember which file I have to search and switch to every time I’m working is something that I enjoy and you’ll probably notice it as well in the long run.&lt;/p&gt;

&lt;h2&gt;
  
  
  Moving the Sidebar (Tool Window or “Project” Explorer)
&lt;/h2&gt;

&lt;p&gt;If you are like me, you’re probably toggling the sidebar from time to time. You probably have a shortcode (keymap) that you use all the time (we’ll explore this at a later point). What happens when the sidebar is on the left is that it pushes the code every single time you make it visible or hide it. Ideally, you won’t need it that often, however, for the times that you actually need it, I prefer to have it on the right side. It is pretty straightforward, &lt;strong&gt;⚙ (Gear Icon) &amp;gt; Move To &amp;gt; Right Top&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xsyfHgow--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-getting-rid-of-the-distractions/9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xsyfHgow--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-getting-rid-of-the-distractions/9.png" alt="" width="687" height="786"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, your IDE starts getting in shape. However, still long way to go! In the next email, we’ll explore themes (why you should pick up based on your surrounding), fonts and more!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZuNPkalq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-getting-rid-of-the-distractions/10.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZuNPkalq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://ntsanov.com/assets/images/posts/phpstorm-but-better-getting-rid-of-the-distractions/10.png" alt="" width="800" height="477"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Next Time
&lt;/h2&gt;

&lt;p&gt;I want to keep the reading time relatively small. So some of the topics that I’ll cover will be split into multiple parts. Next time, I’ll cover:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Picking up a Theme (determine the best theme based on your surrounding)&lt;/li&gt;
&lt;li&gt;Picking up a Font (determine the best font for readability)&lt;/li&gt;
&lt;li&gt;Better Icons&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And we’ll slowly start getting into more complex material (PSR-12, shortcodes, settings and more).&lt;/p&gt;

&lt;h2&gt;
  
  
  More Useful Materials
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Christoph Rumpel has nicely &lt;a href="https://www.youtube.com/watch?v=3SUtEnMj1ws"&gt;illustrated&lt;/a&gt; some of the concepts that I’ve covered in this email. Make sure to check him out!&lt;/li&gt;
&lt;li&gt;If you want to find more on how to set up PhpStorm with Xdebug &amp;amp; Docker, you can find Derick Rethans’s &lt;a href="https://vimeo.com/433218463"&gt;walkthrough&lt;/a&gt; interesting. Derick is also the creator of Xdebug, so he’s the best person you can find for the job.&lt;/li&gt;
&lt;li&gt;For the people using Laravel’s Homestead, Daniel Verner’s &lt;a href="https://dev.to/daniel_werner/how-to-set-up-debugging-with-phpstorm-and-homestead-484g"&gt;post&lt;/a&gt; on this topic will be of a good use!&lt;/li&gt;
&lt;li&gt;PhpStorm is known to have some performance issues. Project Lanai is a joint effort between JetBrains and Oracle that looks to solve this. Check Alex Vanderbist’s (member of Spatie) &lt;a href="https://alexvanderbist.com/2020/enable-early-access-metal-support-for-jetbrains-ides/"&gt;post&lt;/a&gt; on this topic.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can also be on the list! Make sure you contact me with a link to your work related to PhpStorm. If I find it useful, it will be included in the next email!&lt;/p&gt;

&lt;h2&gt;
  
  
  News (Things That You Might Have Missed)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;PhpStorm 2020.1.3 has been released! Mainly bug fixes - make sure you check out the &lt;a href="https://blog.jetbrains.com/phpstorm/2020/07/phpstorm-2020-1-3-is-released/?fbclid=IwAR3Fvp5o46N0OFfJGlLp9kInWfk9h-VPITwM-By-01zbJlfmyjOSFK3YRDA"&gt;changelog&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Support for Psalm is &lt;a href="https://blog.jetbrains.com/phpstorm/2020/07/phpstan-and-psalm-support-coming-to-phpstorm/"&gt;coming soon&lt;/a&gt; (probably 2020.3).&lt;/li&gt;
&lt;li&gt;PhpStorm 2020.2 will introduce many cool stuff including PHP 8 Union Types support. Read more on their &lt;a href="https://blog.jetbrains.com/phpstorm/2020/07/phpstorm-2020-2-eap-6-union-nbsp-types-are-here/"&gt;blog&lt;/a&gt;!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;I’m really excited to hear what you think about the newsletter. Make sure you drop me a line on &lt;a href="https://twitter.com/NikolayTsanov"&gt;Twitter&lt;/a&gt;! I really appreciate spreading the word about this and I’m welcoming all suggestions!&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>phpstorm</category>
      <category>tools</category>
      <category>php</category>
    </item>
    <item>
      <title>PhpStorm, But Better! - Tips &amp; Tricks Newsletter</title>
      <dc:creator>Nikolay Tsanov</dc:creator>
      <pubDate>Sat, 04 Jul 2020 14:39:42 +0000</pubDate>
      <link>https://dev.to/ntsanov/phpstorm-but-better-tips-tricks-newsletter-2emg</link>
      <guid>https://dev.to/ntsanov/phpstorm-but-better-tips-tricks-newsletter-2emg</guid>
      <description>&lt;p&gt;There is a plethora of tips and tricks about PhpStorm that are unknown out there. People tend to set it up once and leave it as it is. Which is good, however, from time to time new features, new plugins or new settings come out and people are just unaware of them, even though they can increase productivity or improve the overall workflow.&lt;/p&gt;

&lt;p&gt;The purpose of this newsletter is to inform you about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;New features coming to PhpStorm&lt;/li&gt;
&lt;li&gt;Useful shortcodes, plugins or other neat tricks&lt;/li&gt;
&lt;li&gt;Links to resources (blogs, tweets etc.) from the great community that uses PhpStorm&lt;/li&gt;
&lt;li&gt;How to make PhpStorm look better&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Many more!!!&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Anyone, that it is interested in receiving such updates from time to time is welcomed to join by going to &lt;a href="http://phpstormbutbetter.com/"&gt;http://phpstormbutbetter.com/&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  When will I receive the first email?
&lt;/h3&gt;

&lt;p&gt;The first email (containing information about setting up PhpStorm, the importance of picking up a theme based on your surrounding and more) will be sent very soon.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I be part of the newsletter?
&lt;/h3&gt;

&lt;p&gt;You are more than welcomed to send your posts, tweets or other information related to PhpStorm that you want to see on the newsletter. More information can be found on the website.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I partner up with you?
&lt;/h3&gt;

&lt;p&gt;I'm opened to anyone who wants to help the newsletter grow. You can contact me on Twitter (@NikolayTsanov - &lt;a href="https://twitter.com/NikolayTsanov"&gt;https://twitter.com/NikolayTsanov&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check out an &lt;a href="https://dev.to/ntsanov/phpstorm-but-better-1-getting-rid-of-the-distractions-51ki"&gt;archive&lt;/a&gt; of the first email from the series!&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>phpstorm</category>
      <category>ide</category>
      <category>php</category>
      <category>newsletter</category>
    </item>
    <item>
      <title>The Importance of the Meta Theme Color (HTML Tricks #1)</title>
      <dc:creator>Nikolay Tsanov</dc:creator>
      <pubDate>Wed, 20 May 2020 14:24:25 +0000</pubDate>
      <link>https://dev.to/ntsanov/the-importance-of-the-meta-theme-color-html-tricks-1-nli</link>
      <guid>https://dev.to/ntsanov/the-importance-of-the-meta-theme-color-html-tricks-1-nli</guid>
      <description>&lt;p&gt;You have probably noticed that on some popular website when visited on mobile, the menu bar in Chrome magically changes its colour to match the primary colour of the page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nCQucdy6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/1%2AsB6AGTW2FeQhpNewsD3XrA.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nCQucdy6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/1%2AsB6AGTW2FeQhpNewsD3XrA.jpeg" alt="The Guardian’s Website" width="800" height="409"&gt;&lt;/a&gt;&lt;em&gt;The Guardian’s Website&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;There is no magic in that. This can easily be achieved by using only one line of code inserted directly into the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; tag of your page. This will suggest to the browser to use this colour rather than the default one.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"theme-color"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"#ffffff"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Other popular websites using this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://edition.cnn.com/"&gt;https://edition.cnn.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.cnet.com/"&gt;https://www.cnet.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/"&gt;https://github.com/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This one line can go a long way in helping your clients notice you and your website. It simply looks more professional and you appear to have spent more time on your design. Support for this feature has been introduced in version 39 of Chrome for Android on Lollipop.&lt;/p&gt;

</description>
      <category>html</category>
      <category>ux</category>
      <category>webdev</category>
      <category>css</category>
    </item>
    <item>
      <title>Integrate Google Tag Manager with an existing cookie consent form</title>
      <dc:creator>Nikolay Tsanov</dc:creator>
      <pubDate>Mon, 04 May 2020 21:00:00 +0000</pubDate>
      <link>https://dev.to/ntsanov/integrate-google-tag-manager-with-an-existing-cookie-consent-form-3l3k</link>
      <guid>https://dev.to/ntsanov/integrate-google-tag-manager-with-an-existing-cookie-consent-form-3l3k</guid>
      <description>&lt;p&gt;Sometimes, Google Tag Manager can be overwhelming. I do like it when it works, but it requires a lot of tinkering before getting the wanted results. Before I start, I must say that I am not an expert in any way with Google Tag Manager, the suggested approach below is just an example of how one can go about solving an issue we experienced working on a project that used VueJS to present the user with a cookie consent banner. We had to provide the user with the option to opt-out or opt-in from certain groups. The “statistics” group included Google Analytics. There might be a prettier solution, however, most of the articles out there only cover scenarios where the website already uses a service such as Cookiebot, OneTrust or other alternatives.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--D3gDKTkg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/9620/1%2AT-iADds-1lCncd92GIIyhA.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--D3gDKTkg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/9620/1%2AT-iADds-1lCncd92GIIyhA.jpeg" alt="Photo by Luke Chesser - Google Analytics"&gt;&lt;/a&gt;&lt;em&gt;Photo by &lt;a href="https://unsplash.com/@lukechesser?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Luke Chesser&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/analytics?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started with Google Tag Manager and Google Analytics
&lt;/h2&gt;

&lt;p&gt;Firstly, we need to set up Google Tag Manager into our existing project and import Google Analytics. Bear in mind, it is really important to remove any previous code related to tracking before adding GTM (I will talk about this later). We will start by adding a new account to Google Tag Manager. For account name, you can choose the name of your project, the name of the company you are working for or anything else you like. Make sure to keep it consistent, soon you might end up with a dozen of projects!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XzAJxhYc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/4760/1%2AFxjEewvDvUfz1VIuToyMmA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XzAJxhYc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/4760/1%2AFxjEewvDvUfz1VIuToyMmA.png" alt="Setup account’s information"&gt;&lt;/a&gt;&lt;em&gt;Setup account’s information&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The account will be the main holder for the containers. A container is simply a bundle of scripts that will execute following some criteria. An example of having multiple containers for one account is if you want to split the various scripts that will run on the main domain and the subdomain. Therefore, you will setup a container for example.com and staging.example.com . We will also pick Web as a targeted platform. Everything here can be changed later on!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mdDYRoCH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/4628/1%2AU_8kWJlcdJIrumn57fEoUw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mdDYRoCH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/4628/1%2AU_8kWJlcdJIrumn57fEoUw.png" alt="Setup a container for the current account"&gt;&lt;/a&gt;&lt;em&gt;Setup a container for the current account&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;After you are done setting up everything, you will be prompted with code snippets that you can directly import into your project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zkdnqK3k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2824/1%2AsU6UG7e8Ll3-t9jNIGuCXg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zkdnqK3k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2824/1%2AsU6UG7e8Ll3-t9jNIGuCXg.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note: You do not need the second code snippet if you are not planning on supporting older browser.&lt;/p&gt;

&lt;p&gt;However, I prefer using a dedicated package that will act as a wrapper around Google Tag Manager. The package will provide one more level of abstraction. Since the project uses VueJS heavily, I came across this lightweight package &lt;a href="https://github.com/mib200/vue-gtm"&gt;https://github.com/mib200/vue-gtm&lt;/a&gt; that also automatically loads the GTM script. There are also some additional configuration that you can do, such as enable or disable it based on a condition and more!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install vue-gtm --save

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



&lt;p&gt;and then import it in your main script, in my case app.js&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;VueGtm&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;vue-gtm&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;Vue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;VueGtm&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;GTM-P42GL2L&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

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



&lt;p&gt;Now, we want to make sure that we only load GTM and nothing else! This is really important, we do not want to track the same thing twice! A neat way to check for this is by using the Tag Assistant extension, available only on &lt;a href="https://chrome.google.com/webstore/detail/tag-assistant-by-google/kejbdjndbnbjgmefkgdddjlbokphdefk?hl=en"&gt;Chrome&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EzUe4bDF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/4248/1%2AyrkyB_BsXlQGU3N2zMb5uQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EzUe4bDF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/4248/1%2AyrkyB_BsXlQGU3N2zMb5uQ.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, navigate to the url of your site and enable the extension (you will probably need to reload when you enable it). You should be displayed with only one tag that has been fired.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GFtNLpOZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AJefPeTP0rBDVh59Odqm3jw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GFtNLpOZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AJefPeTP0rBDVh59Odqm3jw.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, you might also end up with a “HTTP response code indicates tag failed to fire: Status 404. This could be due to an empty or un-published container”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pz9Ku1o0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AceHSBNsYgZfc9f-lWcXbRw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pz9Ku1o0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AceHSBNsYgZfc9f-lWcXbRw.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The warning is pretty self-explanatory, make sure you publish your container or preview it. Both will work. Make sure your container if published for production!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Xu-czzQa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2Apj1XTVkRfECk2YbLNaSNWw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Xu-czzQa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2Apj1XTVkRfECk2YbLNaSNWw.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that we have everything up and running, we can add our Google Analytics Tracking ID to GTM (I assume you already have such, it should be in the format UA-XXXXXXXXX–X). To add a script to your site you need to add a tag in Google Tag Manager. Your tag’s configuration should looks as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--A1X8c6at--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2A5wFeLFEoylEmpFZhs-Ca2Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A1X8c6at--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2A5wFeLFEoylEmpFZhs-Ca2Q.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For a tag to be fired (a script to be loaded) on your website, you need to set up a trigger for it. The trigger that we are going to set will read a value from a cookie and based on that fire the tag. Therefore, if the tag is not fired then the user would not get GA cookies set in the browser. We want to fire the tag on all pages so we will select “Page View” as a trigger. But, we also want to restrict this by checking whether we are allowed to fire the tag or not. This can be done by selecting the “Some Page Views” option and adding a new variable or choosing from the existing ones.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--U1C-Ty0S--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AaHEpU9Rb-9KN5CPPerWDkw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--U1C-Ty0S--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AaHEpU9Rb-9KN5CPPerWDkw.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In our case, we would want to make a custom variable that holds the consent value. Now, there are few options that we can pick. The first one is to make a new variable of type “Custom Javascript” and have some code inside that reads from the document.cookie . While this is a realistic approach, it requires placing logic inside GTM, which I am not fan of. A better approach, in my opinion, is to read from a global javascript variable. As far as I know, most of the popular cookie consent services use a similar approach. This global variable can be controlled from the website.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AtBLxJDK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AHInXP6vnV_mmlozf72znDg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AtBLxJDK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AHInXP6vnV_mmlozf72znDg.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SAVaI8UX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2880/1%2Ak9_Mz70QsvsJRWizpwrvDg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SAVaI8UX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2880/1%2Ak9_Mz70QsvsJRWizpwrvDg.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, our Page View Trigger should fire only when the user consented to statistics.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kywGMHz0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AKKZzzG_YyvJTpeamJdmKxg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kywGMHz0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AKKZzzG_YyvJTpeamJdmKxg.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We are pretty much done. Now, we only need to add the trigger to the tag we made. On the website, you can present the user with a custom banner, popup or anything else you want. When the user agrees or declines, you can set a cookie which will keep track of the consent. This cookie can be used to set the global variable (every time the page reloads). The good thing now is that GTM does not rely on a cookie, but rather on a global variable that can be set in various ways: local storage, cookies etc.&lt;/p&gt;

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

&lt;p&gt;The amazing part of Google Tag Manager is that it is highly customizable. There are various ways of implementing a GDPR form with it. To finish of, here is a list of great resources where you can explore more about GDPR and GTM:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Analytics Mania &lt;a href="https://www.analyticsmania.com/post/gdpr-cookie-consent-notification-with-google-tag-manager/"&gt;https://www.analyticsmania.com/post/gdpr-cookie-consent-notification-with-google-tag-manager/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sebastian Wismayer &lt;a href="https://sebastianwismayer.com/blog/step-by-step-visual-guide-to-gdpr-conform-cookie-consent/"&gt;https://sebastianwismayer.com/blog/step-by-step-visual-guide-to-gdpr-conform-cookie-consent/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Simo Ahava has an amazing blog dedicated to GTM tips &amp;amp; tricks. I highly recommend checking him out at &lt;a href="https://www.simoahava.com/categories/gtm-tips/"&gt;https://www.simoahava.com/categories/gtm-tips/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thank you for reading this article! Hope you found it interesting and helpful. You can find me on Twitter (@&lt;a href="https://twitter.com/NikolayTsanov"&gt;NikolayTsanov&lt;/a&gt;).&lt;/p&gt;

</description>
      <category>php</category>
      <category>seo</category>
      <category>googletagmanager</category>
      <category>googleanalytics</category>
    </item>
  </channel>
</rss>
