<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Stefan Bauer on Medium]]></title>
        <description><![CDATA[Stories by Stefan Bauer on Medium]]></description>
        <link>https://medium.com/@stefanbauer?source=rss-1ec63c5cf4c9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ILTw-8skgjZM_Bi3uq6S6A.jpeg</url>
            <title>Stories by Stefan Bauer on Medium</title>
            <link>https://medium.com/@stefanbauer?source=rss-1ec63c5cf4c9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 14:08:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@stefanbauer/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The hell of taxes when building a SaaS in Europe]]></title>
            <link>https://medium.com/@stefanbauer/the-hell-of-taxes-when-building-a-saas-in-europe-9802887f7ec6?source=rss-1ec63c5cf4c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/9802887f7ec6</guid>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[billing]]></category>
            <category><![CDATA[taxes]]></category>
            <category><![CDATA[saas]]></category>
            <dc:creator><![CDATA[Stefan Bauer]]></dc:creator>
            <pubDate>Fri, 07 Dec 2018 15:30:16 GMT</pubDate>
            <atom:updated>2018-12-07T15:30:16.489Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bv0GV7mmNOCTYtRY8OOJEg.png" /></figure><p><strong>This post refers exclusively to my personal experience when I tried to build my brand new SaaS project </strong><a href="https://pingping.io/"><strong>PingPing.io</strong></a><strong> — a simple Website and SSL Monitoring platform.</strong></p><p>In the end, one thing should be clear: Even if you build your project for fun at first, it should still make money at the end of the day. When my project was about to be launched, and the prices of the respective plans were set, there was one thing I had to take care of. The implementation of the payment.</p><p>You might think this isn’t really that complicated. Use Stripe, its great integration possibilities and that’s it. Then you can earn money. It’s not that easy. At least not if you, like me, <strong>live in Germany and are bound by German and European laws.</strong> Why? Let me explain it to you.</p><p>One of the biggest problems is billing. Here in Germany, the legislator sets quite clear requirements for the writing of invoices. In addition to mandatory information such as: Consecutive invoice number, date and complete recipient information you must also have some other things on it. For example, the total amount and how it is composed of the net amount plus tax.</p><h3>Communicating the pricing</h3><p>Depending on the rule, different taxes, or even none at all, must be declared. We will come to the exact rules later. That inevitably leads you to the question: <strong>Which prices should you write on your website?</strong> Here were my thoughts.</p><h3>Net prices on the website</h3><p>So if I write on the website that my product costs $15 net with a hint that tax will be added on checkout, that means:</p><ul><li>Some people from certain countries pay exactly $15 since I do not declare tax</li><li>Other people pay $15 plus the respective tax in the country they come from. That can be 16%, 18% or maybe even 22%.</li></ul><p>The disadvantage is clear: every customer pays a different price. The customer feels rightly treated unfairly. In summary, you can say that one pays $15 and the other maybe $18.30.</p><p>It makes no difference to me because I can’t keep the tax anyway.</p><h3>Gross prices on the website</h3><p>So if I want every customer to pay the same price at the end, I have to write the gross price on the website. This at least solves the problem which prices I write on my website. Nice thinking, all solved. Well, … quite.</p><p>The disadvantage is now that I lose profit because the taxation is now on my side and will be subtracted (if there is any) from the gross price and I only get the net amount.</p><h3>Invoicing itself</h3><p>After I decided for gross prices on the website, the invoicing has to be considered now. Before I thought about choosing a payment provider, I talked to my tax advisor about all the things I have to pay attention to.</p><blockquote><em>I didn’t know whether to cry or laugh.</em></blockquote><h3>The rules</h3><p>Let us come to the rules on when and how to declare tax on invoices. Hold on tight! It’s gonna suck. You have to consider the following things:</p><ul><li>Is it an electronic, a service or a physical product?</li><li>Where is the service provided?</li><li>Is the customer a private customer or a company?</li><li>Is he from Germany?</li><li>Is he from the EU or just from Europe but not EU?</li><li>Or is he from a third country?</li><li>Does he have a valid VAT ID or not?</li></ul><p>Depending on all these possible combinations, you will finally get the correct “rule” on how to declare the tax. <strong>Easy, isn’t it?</strong> Haha! I want to show you some combinations. So that you understand how complex the whole subject is.</p><p>Since January 2010, the basic rule has been that services are taxable where the recipient of the service, i.e. your client, is based. However, because this would be very costly, there is a new regulation. The reverse charge procedure.</p><p>The so-called reverse charge procedure applies to the treatment of value-added tax in other European countries. In practice, this means that you as the recipient of the service calculate the tax yourself on the basis of the tax rate in your country. You declare this amount to the tax office responsible for you and deduct it as input tax. This means that there is no need to register as a German service provider in a foreign country.</p><h3>Examples</h3><p>Here are only a few examples with different combinations of the questions above. I always assume that the invoice will be issued from Germany.</p><ul><li><em>Recipient is </em><strong><em>not based in the EU</em></strong><em> but </em><strong><em>within Europe</em></strong><em> and a </em><strong><em>private</em></strong><em> or </em><strong><em>company</em></strong><em> customer</em></li></ul><p>You are taxable in the country where your customer comes from. That in mind means: You need to to know the current tax of that country and use that. So it can be 12%? 15%? 20%? You have to check that out.</p><ul><li><em>Recipient is </em><strong><em>based in the EU</em></strong><em> and a </em><strong><em>private</em></strong><em> customer</em></li></ul><p>You are taxable in Germany. That means the tax from Germany. 19%.</p><ul><li><em>Recipient is </em><strong><em>based in the EU</em></strong><em> and a </em><strong><em>company</em></strong><em> customer and provide a </em><strong><em>valid VAT ID</em></strong></li></ul><p>Actually, you are taxable in the country where your customer comes from. You’d have to pay taxes there. But thanks to that awesome “reverse charge procedure” you don’t have to declare any tax. The customer himself has to declare his tax, for his country in his country.</p><ul><li><em>Recipient is </em><strong><em>based in the EU</em></strong><em> and a </em><strong><em>company</em></strong><em> customer and doesn’t provide a VAT ID</em></li></ul><p>This will be handled as the customer would be a regular private customer. That means: Taxable in Germany, 19%.</p><ul><li><em>Recipient is </em><strong><em>based in third country</em></strong><em> (not EU) and a </em><strong><em>private</em></strong><em> customer</em></li></ul><p>You are taxable in Germany. That means the tax from Germany. 19%.</p><ul><li><em>Recipient is </em><strong><em>based in third country</em></strong><em> (not EU) and a </em><strong><em>company</em></strong><em> customer</em></li></ul><p>I would say something like “You can decide” :) In general, don’t declare any tax. But it might be that the country where your customer comes from, participates in the “reverse charge procedure”. If that’s the case, the customer has to declare the tax in his country. But it’s not enough! Some third countries declare separate taxes for services and they are still different. So actually? I don’t know. You have to search for that, ask your account, or whatever. What I can tell you. In any case, you won’t find an answer at all.</p><ul><li>To be continued…</li></ul><p>Oh and by the way: I left out some minor German things. For instance: You have to have an evidence, that the VAT ID the customer entered at the time of purchasing is and was valid. Just checking if it’s valid is not enough. You need a real evidence, like something a screenshot or so.</p><h3>The Payment Provider</h3><p>With all these thoughts I had to find a payment provider. Not only a payment provider but also a provider who creates the correct invoices for me, because honestly… I don’t want to check all those **** rules.</p><p>I love <a href="https://stripe.com/">Stripe</a>. But I couldn’t use Stripe alone. Since Stripe is only responsible for payment. The invoices that Stripe creates for me don’t help me because I have to declare the correct tax. Fortunately, there is another service. <a href="https://quaderno.io/">Quaderno</a>.</p><blockquote><em>Quaderno manages sales tax, VAT, and GST for you, automatically. We handle thousands of receipts every month from businesses of all sizes, all around the world.</em></blockquote><p>Seems cool. So what they do is: You connect Stripe to Quaderno. Quaderno monitors all incoming payments from Stripe and creates a correct invoice with the correct tax. Means they calculate a net price add the appropriate tax so the gross price is the price you charged for. Cool!</p><p>I have to admit, a little more work is needed. You have to send all relevant data (name, street, etc.) as metadata to Stripe. This is the only way for Quaderno to decide how the tax is to be calculated and which rule comes into effect.</p><p>After I implemented everything, everything ran wonderfully. Until the day with my tax consultant.</p><h3>Why I switched from Stripe/Quaderno to Paddle</h3><p>As you have learned from the rules above, however, there are cases where the tax is due in the target country. This means that I have to pay tax in the country where the customer has his location. At least if the corresponding rule applies. And that again means that I have to register my company in every country in which I declare the tax applicable there.</p><blockquote><em>WTF? Really? WTF?</em></blockquote><p>If you don’t do this, you’re risking high penalties in other countries. That was too much for me. I was just thinking about selling PingPing. Or maybe even stop it. But then I came across a solution that solves all my problems.</p><p>And the solution is: <a href="https://paddle.com/">Paddle</a></p><p>So here is something from their website, as they can better explain it than me.</p><blockquote><em>We act on your behalf as what is called a Merchant of Record (MOR).</em></blockquote><blockquote><em>From a legal point of view, this means that we are the reseller of your software. Most importantly, this also means that we assume responsibility for both compliance with local laws and regulations and handling of taxes on your behalf. We have to behave as if we had created the software ourselves.</em></blockquote><blockquote><em>Contracting with MOR gives considerable benefits to you, because you don’t need to do anything, when it comes to dealing with compliance and taxes anywhere in the world: we handle everything for you automatically as part of our normal service. As we detail in a minute, you’ll see that this is both really important and really complex.</em></blockquote><p>That means: They are the service provider to your customers. They create the subscriptions, they charge them and they create the invoices. You are not involved anymore. At least until here. The only time you’re still involved is the payout. You get, whenever you want, a simple payout with a credit note. That’s it. You don’t have to take care of paying taxes or anything else. They are responsible for that.</p><p>And the cool thing? They support credit card, as well as PayPal and ApplePay.</p><p>It’s important to understand that they are very different from other payment providers like PayPal, Stripe or whatever, as they don’t act as a MOR.</p><h3>Conclusion</h3><p>Now you know why I call it hell. I understand well why many companies are based in the US, Canada or elsewhere. The main thing is not in the EU. I was close to stopping my project. But at this point I have to say again:</p><p><strong>Thanks, </strong><a href="https://paddle.com/"><strong>Paddle</strong></a><strong>, that you exist.</strong></p><p>Even though there are some things that really bother me about Paddle. No sandbox, missing statistics, the integration is not customizable and important endpoints are missing in the API. But I hope that this will be better in the future.</p><p>How was your experience? What have you done? How did you do it? All that would be interesting. Send me a direct message on Twitter or follow me. Let’s share experience and ideas.</p><p><strong>Thanks for reading this! If you enjoyed it, don’t forget to leave some claps 👏🏼. Share this with your friends and followers! If you would like to join me, </strong><a href="https://twitter.com/stefanbauerme"><strong>follow me</strong></a><strong> or </strong><a href="https://twitter.com/pingpingapp"><strong>PingPing</strong></a><strong> on Twitter.</strong></p><p><em>Originally published at </em><a href="https://stefanbauer.me/the-hell-of-taxes-when-building-a-saas-in-europe/"><em>stefanbauer.me</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9802887f7ec6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My SaaS-Journey from 87 followers to first profit]]></title>
            <link>https://medium.com/@stefanbauer/my-saas-journey-from-87-followers-to-first-profit-c57abc47d802?source=rss-1ec63c5cf4c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/c57abc47d802</guid>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[bootstrapping]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[saas]]></category>
            <category><![CDATA[saas-marketing]]></category>
            <dc:creator><![CDATA[Stefan Bauer]]></dc:creator>
            <pubDate>Sat, 24 Nov 2018 11:24:53 GMT</pubDate>
            <atom:updated>2018-11-24T13:34:59.288Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aj1HocJlD45WP_u3jNzoTw.png" /></figure><p>This story shows you my SaaS-Journey of <a href="https://pingping.io/">PingPing.io</a> — a simple Website and SSL Monitoring platform.</p><p>It was the year 2017, January. I have worked in many companies. Mostly as a developer, but lately I’ve only been responsible for IT. All companies had the same problems. How can you make sure that websites stay online and SSL certificates are valid?</p><p>There are a lot of very good solutions out there that offer solutions to these problems. We are talking about monitoring systems. I am not lying when I say that I know, have tested and have used most of these systems. For me (almost) all solutions have the same “problem”. They have too many features. Not that it’s bad to have many features, but the problem is that you have to pay for that variety of possibilities. What I need is simple:</p><ul><li>Notification when my websites are down</li><li>Notification when my SSL certificates are not valid (anymore)</li></ul><p>No more, no less. I don’t need automated test workflows. I don’t need to verify SSL chains.</p><p>So I decided to build this solution myself. The requirement is relatively clear.</p><ul><li>Create websites</li><li>Send notification if something happens</li></ul><p>Sounds simple, doesn’t it?</p><h3>The Start</h3><p>So I started to develop this thing. There was no product name at that time. It was also never thought to make this project public. It should be small, but a fine project, which goes as fast as possible in the development. Based on these requirements, I decided on the following stack:</p><ul><li><a href="https://laravel.com/">Laravel PHP</a> as Framework</li><li><a href="https://horizon.laravel.com/">Laravel Horizon</a> as queueing system to process the checks</li><li><a href="https://tailwindcss.com/">TailwindCSS</a> as Frontend Framework, mixed with <a href="https://vuejs.com/">VueJS</a></li></ul><p>I decided to create the whole thing as an open source project so that the “world” could participate and benefit. I wrote about my project on Twitter and published the first blog post.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*B3k89TtI-CuLHtc3.png" /><figcaption>Very first blog post about creating PingPing.io</figcaption></figure><p>I’m actually the silent co-reader. Whether in Slack or on Twitter. I read a lot, am always informed, but not very active myself. At that time my Twitter profile looked like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/0*kq848Vaj65abuNSz.png" /><figcaption>87 Followers when I decided to start</figcaption></figure><p><strong>312 Tweets, 124 Following, and 87 Followers.</strong></p><h3>It’s gonna be a commercial project</h3><p>I invested some money at some point and joined the <a href="https://megamaker.co/">MegaMakerClub</a>. A community by and for Bootstrappers created by <a href="https://twitter.com/mijustin">Justin Jackson</a>. I met Justin as a very nice guy from next door. I got some information about who this guy is and what he does. I was especially convinced by his talk about marketing on the <a href="https://laracon.us/">Laracon</a>. Also there I am the silent co-reader. But I can highly recommend everyone to join there. The money is worth it. The community is really great, very helpful and supports each other with many questions.</p><p>I also have regular contact with <a href="https://twitter.com/adamwathan">Adam Wathan</a> (author of <a href="https://adamwathan.me/refactoring-to-collections/">Refactor to Collection</a>, creator of <a href="https://course.testdrivenlaravel.com/">Test Driven Laravel</a>, <a href="https://adamwathan.me/advanced-vue-component-design/">Advanced Vue Component Design</a>, and <a href="https://tailwindcss.com/">TailwindCSS</a>). We also exchange ideas here and there about different topics. I have the feeling that I annoy him sometimes, but Adam always takes time to answer questions or write his opinion. At this point “Thanks” to Adam, who has to bear me again and again.</p><p>Why am I telling this? Because it’s incredibly important to be with people who are where you want to be and especially with whom you can identify. Find mentors. You can not only learn from them, but they also bring you forward. Adam, as well as many people in the MegaMaker community, are permanent members of our community. Don’t underestimate that.</p><p>In any case, it turned out very quickly that my blog posts about <a href="https://pingping.io/">PingPing</a> received a lot of attention. Yes, meanwhile there was even a name. Not least because Adam and the community supported me in the form of tweets.</p><p>The result was that within a week I had a subscriber list of about <strong>300 subscribers</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jznZ5-A8H9vYpU0w.png" /><figcaption>ConverKit Subscribers are growing</figcaption></figure><p>And about <strong>200 followers</strong> on Twitter</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/0*e5VKv113JTzXFrnk.png" /><figcaption>Twitter Followers are growing</figcaption></figure><p>I received a lot of feedback from blog readers that they were willing to pay money for the product.</p><p>Wait a minute. You want to pay money? I talked to some people again and in the end, it was clear that I would make it a commercial project.</p><h3>Verify the product idea</h3><p>I’ve made the mistake of developing a project in the past without verifying the idea. <strong>Don’t do that!</strong> This only ends in frustration. You develop. You invest time. And in the end, you realize that you have developed past the market. That should be different this time.</p><p>So I quickly built a landing page where I announced PingPing. With the possibility to subscribe to a list. At the same time, I started with the development.</p><p>Soon it turned out that my Twitter followers are getting more and more (meanwhile <strong>more than 300 followers</strong>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/0*NCoIoqbUsnjszT4s.png" /><figcaption>And growing</figcaption></figure><p>The list was growing too (meanwhile <strong>nearly 500 subscribers</strong>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*efo5Ysi11DhS_60V.png" /><figcaption>And growing</figcaption></figure><p>So it seems to be the right direction. The idea seems to work, although there are already many competitors.</p><h3>Before launch — the beta test</h3><p>Nothing much has happened up to this point. Except that I developed PingPing in a constant and focused way. Here and there some people had to motivate me again and again. That’s important. Have people who motivate you to keep going.</p><p>I had set myself firm plans for the MVP. Now it was time to test the whole thing. For this, it was important that I get strangers. People I don’t know. People who don’t know the product. People who openly and honestly tell me what they think about the product. I decided to send an email to my list. It had grown to 500 subscribers by this time. Who wants to be a beta tester?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*I5ewgw8e0LRsD5vP.png" /><figcaption>I need some beta testers</figcaption></figure><p>More than 30 people contacted me. That was a little too much for me. I decided to pick out 10 people.</p><h3>Take a close look at your testers</h3><p>The experience was good but also bad.</p><p>Half of the testers are really interested in the product. They want to make the product better. They have ideas. They have suggestions. And they test your product very carefully. Not only functionally, but also in the area of security. Here I got many valuable hints. I have implemented a lot of ideas and suggestions.</p><p>Then there is the other half. Motivated at the beginning. But very quickly it becomes clear that they actually don’t have time to seriously test the product. Maybe they just think they’ll get the product for free at the end. I don’t know.</p><p>So here’s my tip: find testers who really have time to test the product. Testers who feel like testing the product. You need loyal testers. And that’s not so easy.</p><p>A word on my own behalf: Thanks to all my testers. My special thanks go to <a href="https://twitter.com/j_kniest">Jordan Kniest</a>. He really invested a lot of time.</p><h3>The Launch</h3><p>On 2018, October 30th the time had come. I decided to launch. If you think that the start is something special, then you are wrong. It’s not. There is no “WOW” effect. Only one load falls off.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9XYn5ddeeA6xiz3_.png" /><figcaption>The “I have launched” Tweet</figcaption></figure><p>I communicated the launch on Twitter and in my email list. The rest was done by the community. Retweets and Likes.</p><h3>The problems</h3><p>I underestimated reality. Developing and testing a SaaS product locally is different than running it productively. Locally or on a staging system, there is not even a rudimentary load that arises productively. So I spent the time after the launch doing performance optimizations because some of my servers were heavily used. The optimizations brought a lot. I can now run the project at a relatively low cost.</p><p><strong>A tip from me: The reality is always different.</strong></p><h3>Today</h3><p>Today is 2018, November 24th. Pricing is difficult. I have changed the prices several times within the last 2 weeks. On the one hand, based on feedback from some users. But also <a href="https://twitter.com/reinink">Jonathan Reinink</a> (Creator of <a href="https://tailwindcss.com/">TailwindCSS</a> and <a href="https://churchsocial.com/">ChurchSocial</a>) was a big help. The exchange was very exciting. His experience is outstanding.</p><p>Here I am today (after 3 weeks of launch):</p><ul><li><strong>More than 400 followers on Twitter</strong></li><li><strong>More than 700 subscribers on my list</strong></li><li><strong>More than $100 MRR</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SVmvsd6moxXY4Pfw.png" /><figcaption>Current MRR</figcaption></figure><p>My product is not yet a month old. I started 3 weeks ago. I have an MRR of about $100. I am satisfied. It’s a side project.</p><h3>Conclusion</h3><p><strong>Don’t give up. Keep going. It will work.</strong></p><p>How was your experience? What have you done? How did you do it? All that would be interesting. Send me a direct message on Twitter or follow me. Let’s share experience and ideas.</p><p><strong>Thanks for reading this! If you enjoyed it, don’t forget to leave some claps 👏🏼. Share this with your friends and followers! If you would like to join me, </strong><a href="https://twitter.com/stefanbauerme"><strong>follow me</strong></a><strong> or </strong><a href="https://twitter.com/pingpingapp"><strong>PingPing</strong></a><strong> on Twitter.</strong></p><p><em>Originally published at </em><a href="http://stefanbauer.me/my-saas-journey-from-87-follower-to-first-profit/"><em>stefanbauer.me</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c57abc47d802" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use custom domains with different TLDs on Laravel Valet]]></title>
            <link>https://medium.com/@stefanbauer/how-to-use-custom-domains-with-different-tlds-on-laravel-valet-b8680a515e66?source=rss-1ec63c5cf4c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8680a515e66</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[laravel]]></category>
            <dc:creator><![CDATA[Stefan Bauer]]></dc:creator>
            <pubDate>Sat, 19 May 2018 05:01:39 GMT</pubDate>
            <atom:updated>2018-05-19T05:01:39.367Z</atom:updated>
            <content:encoded><![CDATA[<p>If you use <a href="https://laravel.com/docs/valet">Laravel Valet</a>, a Laravel development environment for Mac minimalists, you have the possibility to set one top-level domain. DnsMasq resolves all domains with that top-level domain to 127.0.0. automatically. But what if there is the need for several different TLDs? Let me show you.</p><h3>What’s the reason behind it</h3><p>Here is my case. A big project of mine has the requirement to load specific language and therefore project configuration based on the given TLD. To get as near as possible the production environment, I wanted to use real TLDs. And as you know, I like the idea, to use the real domains with a local subdomain prefix. Let&#39;s try to achieve that.</p><h3>Configuration</h3><p>Get rid of DnsMasq and ignore it. What I do now is really simple. Use the valet park command in your the directory, where all your sites live.</p><h3>Naming project folders</h3><p>Here is the trick:</p><p>Use as a project/webpage directory the domain you would use. In my case, I have directories like this:</p><ul><li>~/Code/local.domain-A.com</li><li>~/Code/local.domain-A.co</li><li>~/Code/local.domain-A.io</li><li>~/Code/local.domain-B.com</li><li>…</li></ul><h3>Resolving the domains</h3><p>The only thing that’s still missing is, that these domains are not resolved to localhost. Easy enough. Add it to the /etc/hosts table.</p><pre>sudo vim /etc/hosts</pre><p>and add it there.</p><p><strong>/etc/hosts</strong></p><pre>127.0.0.1 local.domain-A.com<br>127.0.0.1 local.domain-A.co<br>127.0.0.1 local.domain-A.io<br>127.0.0.1 local.domain-B.com</pre><p>That’s it. Now go to your browser and call one of your domain.</p><h3>Conclusion</h3><p>This is a very easy way to use customized domains. I am not sure if it’s necessary to add these host entries. I got the hope that this is also with DnsMasq possible, but I didn’t find a way to do it, to resolve local.* subdomains to 127.0.0.1. If you know a way, please let me know :)</p><p>Success! Now check your email to confirm your subscription.</p><p>If you would like to join me, <a href="https://twitter.com/stefanbauerme">follow me</a> on Twitter.</p><p><em>If you enjoyed this article, please help out your friends with a</em> 💙<em> or a share.</em></p><p><strong><em>I am </em></strong><a href="https://medium.com/u/1ec63c5cf4c9"><strong><em>Stefan Bauer</em></strong></a><strong><em>, a Developer, Team-Leader, UI/UX Enthusiast and Bacon-Lover located Germany, Munich. I love PHP, Symfony, Laravel and great UI.</em></strong></p><p><em>Originally published at </em><a href="https://stefanbauer.me/how-to-use-custom-domains-with-different-tlds-on-laravel-valet/"><em>stefanbauer.me</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8680a515e66" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use TailwindCSS with Symfony’s Encore]]></title>
            <link>https://medium.com/@stefanbauer/how-to-use-tailwindcss-with-symfonys-encore-542278285a9a?source=rss-1ec63c5cf4c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/542278285a9a</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[symfony]]></category>
            <category><![CDATA[webpack]]></category>
            <dc:creator><![CDATA[Stefan Bauer]]></dc:creator>
            <pubDate>Thu, 10 May 2018 14:15:18 GMT</pubDate>
            <atom:updated>2018-05-10T14:15:18.281Z</atom:updated>
            <content:encoded><![CDATA[<p>Published on May 10, 2018</p><p>The integration of <a href="https://tailwindcss.com/">TailwindCSS</a> into Symfony’s <a href="https://www.npmjs.com/package/@symfony/webpack-encore">Webpack-Encore</a> is quite easy. Here I’m gonna show you how it works.</p><h3>Install the needed dependencies</h3><p>First of all, we need to install the dependecies we need. I use less in my case. If you would like to use scss, you can. Just pull in the apropriate package. We&#39;re also gonna install the autoprefixer package. And of course we need TailwindCSS itself. TailwindCSS needs a package called postcss-loader. So let&#39;s also pull that it. So we end up with something like</p><pre>yarn add --dev @symfony/webpack-encore less-loader less autoprefixer postcss-loader tailwindcss</pre><p>The result should be a <strong>package.json</strong> like this:</p><pre>{<br>    &quot;devDependencies&quot;: {<br>        &quot;<a href="http://twitter.com/symfony/webpack-encore">@symfony/webpack-encore</a>&quot;: &quot;^0.19.0&quot;,<br>        &quot;autoprefixer&quot;: &quot;^8.4.1&quot;,<br>        &quot;less&quot;: &quot;^2.7.3&quot;,<br>        &quot;less-loader&quot;: &quot;^4.0.5&quot;,<br>        &quot;postcss-loader&quot;: &quot;^2.1.5&quot;,<br>        &quot;tailwindcss&quot;: &quot;^0.5.3&quot;<br>    },<br>    &quot;license&quot;: &quot;UNLICENSED&quot;,<br>    &quot;private&quot;: true,<br>    &quot;scripts&quot;: {<br>        &quot;dev-server&quot;: &quot;encore dev-server&quot;,<br>        &quot;dev&quot;: &quot;encore dev&quot;,<br>        &quot;watch&quot;: &quot;encore dev --watch&quot;,<br>        &quot;build&quot;: &quot;encore production&quot;<br>    }<br>}</pre><h3>Configuration</h3><p>Configuration is so simple. I created my tailwind.js configuration file in the my projects root. Additionally to that, I also created my app.less file in assets/less/app.less with all the basic tailwind stuff you can find <a href="https://tailwindcss.com/docs/installation#3-use-tailwind-in-your-css">here</a>.</p><p>There are only two things missing:</p><ul><li>Webpack should use our less-loader</li><li>Webpack should use tailwind and autoprefixer as postcss modules</li></ul><p>Easy enough!</p><p><strong>webpack.config.js</strong></p><pre>var Encore = require(&#39;<a href="http://twitter.com/symfony/webpack-encore">@symfony/webpack-encore</a>&#39;);</pre><pre>Encore<br>    .setOutputPath(&#39;public/build/&#39;)<br>    .setPublicPath(&#39;/build&#39;)<br>    .cleanupOutputBeforeBuild()<br>    .enableSourceMaps(!Encore.isProduction())<br>    .enableVersioning(Encore.isProduction())</pre><pre>    .addEntry(&#39;js/app&#39;, &#39;./assets/js/app.js&#39;)<br>    .addStyleEntry(&#39;css/app&#39;, &#39;./assets/less/app.less&#39;)</pre><pre>    .enableLessLoader()<br>    .enablePostCssLoader()<br>;</pre><pre>module.exports = Encore.getWebpackConfig();</pre><p><strong>postcss.config.js</strong></p><pre>let tailwindcss = require(&#39;tailwindcss&#39;);</pre><pre>module.exports = {<br>     plugins: [<br>         tailwindcss(&#39;tailwind.js&#39;), // your tailwind configuration<br>         require(&#39;autoprefixer&#39;),<br>     ]<br> }</pre><h3>Run</h3><p>That’s it. Now you can just run it as always.</p><pre>yarn run dev</pre><p>for development.</p><pre>yarn run watch</pre><p>if you would like to run the watcher.</p><pre>yarn run build</pre><p>to run the production build.</p><p>If you would like to join me, <a href="https://twitter.com/stefanbauerme">follow me</a> on Twitter.</p><p><em>If you enjoyed this article, please help out your friends with a</em> 💙<em> or a share.</em></p><p><strong><em>I am </em></strong><a href="https://medium.com/u/1ec63c5cf4c9"><strong><em>Stefan Bauer</em></strong></a><strong><em>, a Developer, Team-Leader, UI/UX Enthusiast and Bacon-Lover located Germany, Munich. I love PHP, Symfony, Laravel and great UI.</em></strong></p><p><em>Originally published at </em><a href="https://stefanbauer.me/how-to-use-tailwindcss-with-symfonys-encore/"><em>stefanbauer.me</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=542278285a9a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[004: Upgrading to Laravel 5.6 using Laravel Shift]]></title>
            <link>https://medium.com/@stefanbauer/004-upgrading-to-laravel-5-6-using-laravel-shift-f53f707c6a2b?source=rss-1ec63c5cf4c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/f53f707c6a2b</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[laravel]]></category>
            <dc:creator><![CDATA[Stefan Bauer]]></dc:creator>
            <pubDate>Sun, 25 Feb 2018 09:33:39 GMT</pubDate>
            <atom:updated>2018-02-25T10:28:35.612Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>Automated, instant Laravel upgrade services by an army of thorough bots and friendly humans too.</em></blockquote><p>This is, how <a href="https://laravelshift.com/">Laravel Shift</a> describes itself. Laravel Shift was created by <a href="https://twitter.com/gonedark">Jason McCreary</a>. How Laravel Shift works, is really easy. It’s an awesome tool as I’m gonna show you in the next chapters.</p><ol><li>Sign in with Git</li><li>Choose your Shift</li><li>Review the upgrade</li></ol><p>Let’s do it together.</p><h3>1. Sign in with Git</h3><p>First let’s login via Git. Click on the “Get started now”-button. There are three login methods at this time. You can choose between GitHub, Bitbucket or GitLab. In my case I use GitHub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7FJTuI5kUHNo7Yne.png" /></figure><p>Provide your credentials and login. Now it’s time to authorize Laravel Shift to get access your VCS, which is GitHub here. Laravel Shift needs access because it needs to know which repository should be upgraded. So just authorize it and you’re good to go.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oYA2zzi94KRiu8vS.png" /></figure><h3>2. Choose your Shift</h3><p>Now it’s time to choose your Shift. You need to know which Laravel version your current project is on and to which version you would like to upgrade. In our case we’re currently at the version 5.5.x and want to upgrade to Laravel 5.6. So create a new Shift and choose what you need to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*S7DoW5xc9MxEd_xM.png" /></figure><h3>Select your repository</h3><p>After you chose the shift, you have to tell Laravel Shift which repository you would like to upgrade. How easy is that? Enter your repository details and start shifting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gW7MnXQ3XvV-nI6B.png" /></figure><h3>The shift is running</h3><p>Now it takes some time. What now happens is, that Laravel Shift examines your repository and your code. It upgrades all the stuff, which is necessary to throw you on the current version of the shift. The cool thing about it is, that it doesn’t do anything without your permission. It creates a pull request where you can review all the stuff, that Laravel Shift did. After the Shift has finished, it’s up to us to decide what we would like to merge and what not. May by there are some more changes we would like to push. But let’s check the review in the next chapter.</p><h3>3. Review the upgrade</h3><p>When Shift has finished, you should see something like that. Click on the branch symbol. This takes you immediately to the createad pull request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mbh62Pua6va3RI3L.png" /></figure><p>You can find the related pull request created here: <a href="https://github.com/stefanbauer/pingping/pull/1">https://github.com/stefanbauer/pingping/pull/1</a>. So now let’s take a look. The most comments what Shift created can be ignored in our case. But there one we should take a closer look at.</p><ul><li>⚠ Shift could not upgrade the following project files since they differed from the default Laravel version. You should compare these project files against the default Laravel 5.6 versions and merge any changes: .env.example</li></ul><p>If you remember, we renamed the .env.example to .env.dist. That&#39;s why Shift did not recognize it. But no problems here, we can do it by our own. Locally I check out this branch shift-6234. There are now two things I&#39;m gonna do.</p><h3>Updating the .env</h3><p>If you take a look at the new default .env.example in the <a href="https://github.com/laravel/laravel/blob/v5.6.0/.env.example">Laravel Project Repository</a>, you’ll find a handful new properties. These are LOG_CHANNEL, MIX_PUSHER_APP_KEY and MIX_PUSHER_APP_CLUSTER. Easy enough. Just copy them over to our .env (which is not under version control) and our .env.dist. Commit it to the Shift-Branch. <a href="https://github.com/stefanbauer/pingping/pull/1/commits/f88f0c8ee69aadf2d790620c1c5cea8800654f83">Here is the commit.</a></p><h3>Installing new dependencies</h3><p>As you can see, that Laravel Shift updates also the composer.json file to fit the current versions, we have to update these packages in our /vendor directory. <a href="https://github.com/stefanbauer/pingping/pull/1/commits/f8464c2ad5b3e61540dddfe207e7203c5687745e">Here is</a>, what Shift did with our composer.json. It suggests, that you run composer update.</p><p><strong>Here is my opinion:</strong> Every single time, when people are running a composer update, I ask them if they are sure and they really know what happens and which versions get be installed. With this command, you updates every single package related to your configuration setting in your composer.json. Be 100% sure, that there are no side effects by updating just blindly every package. I am not a big fan of this approach, because I don&#39;t know what happens exactly and why packages get updated and which features/changes/bugfixes are in the latest versions. My advise in general is:</p><p><strong>Update carefully and selectively!</strong> Update package by package. You can do that with composer update my/package. If you&#39;re unsure why a package will or will not be installed, there is always the possibility to use the command composer why or composer why-not to get more information. So for example: If we are interested in, why the package symfony/debug has been installed, we can use the above command.</p><pre>➜ pingping git:(master) composer why symfony/debug<br>laravel/framework v5.6.2 requires symfony/debug (~4.0)<br>symfony/http-kernel v4.0.4 requires symfony/debug (~3.4|~4.0)</pre><p>In our case it’s fine to a run a composer update, as we have no custom packages pulled in and I know what has been changed in these packages. So give it a run! This updates our composer.lock. Now it&#39;s time to commit that too and push it up to the shift branch. The result of this commit you can find <a href="https://github.com/stefanbauer/pingping/pull/1/commits/7b6d885a9969a8d237d4392f4b08aeb5e29352a0">here</a>.</p><h3>Merging back</h3><p>That’s it. We’re done. We reviewed everything. We modified everything that was necessary and now the time has come to merge that into our master branch. As you know me, I do everyhing on the CLI because I have more control. Here, I merge it (just for you) in the GitHub UI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qNP284I0BJ_Y7L_3.png" /></figure><p>Some words on that: Laravel Shift created four commits as I remember. We pushed another two commits on that branch. What I hate, even if some other people always saying that this doesn’t matter, is a dirty and messy git history. I love clean and simple git histories, that show the progress in a very clean and simple way. Should be readable like a book. So we squash all the commits of the shift branch down to one with a simplified but clear commit message.</p><p><strong>Congratulations! We’re done!</strong> This was the very first time, I’ve ever tried <a href="https://laravelshift.com/">Laravel Shift</a>. I was surprised how easy it was. I can highly recommend it to everyone who’d like to upgrade Laravel projects without any hassle.</p><p>If you would like to join me, <a href="https://stefanbauer.me/building-pingping/">sign up now</a>, follow <a href="https://twitter.com/stefanbauerme">me</a> and <a href="https://twitter.com/pingpingapp">@pingpingapp</a> on Twitter.</p><p><em>If you enjoyed this article, please help out your friends with a</em> 💙<em> or a share.</em></p><p><em>I am </em><a href="https://medium.com/u/1ec63c5cf4c9"><em>Stefan Bauer</em></a><em>, a Developer, Team-Leader, UI/UX Enthusiast and Bacon-Lover located Germany, Munich. I love PHP, Laravel and great UI.</em></p><p><strong><em>I’m building </em></strong><a href="https://twitter.com/pingpingapp"><strong><em>PingPing.io</em></strong></a><strong><em>, a free, open source and easy to use monitoring SaaS Application for everyone in public. If you like, </em></strong><a href="https://stefanbauer.me/building-pingping/"><strong><em>we can build it together</em></strong></a><strong><em>. You can follow me on </em></strong><a href="https://twitter.com/stefanbauerme"><strong><em>Twitter</em></strong></a><strong><em> to be part of my daily work.</em></strong></p><p><em>Originally published at </em><a href="https://stefanbauer.me/building-pingping/upgrading-to-laravel-56-using-laravel-shift/"><em>stefanbauer.me</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f53f707c6a2b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[002: Let’s get the ball rolling]]></title>
            <link>https://medium.com/@stefanbauer/building-pingping-002-lets-get-the-ball-rolling-b51ffaf806d8?source=rss-1ec63c5cf4c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/b51ffaf806d8</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[saas]]></category>
            <dc:creator><![CDATA[Stefan Bauer]]></dc:creator>
            <pubDate>Sun, 21 Jan 2018 21:17:19 GMT</pubDate>
            <atom:updated>2018-02-25T10:28:12.763Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*MI6ZG_IUZ6qoGZmcxpE6VA.png" /></figure><p>This series is not intended to be for complete beginners. Basically, I assume that you are familiar with your personal development environment, you can setup a new Laravel project and get the project running in the browser.</p><p>You should have an environment that works right now. I personally work on an Apple MacBook. Due to other projects and special configurations, I rely on an installation and configuration of my software by <a href="https://brew.sh/">brew</a>, a package manager for macOS. But feel free to use <a href="https://laravel.com/docs/5.5/valet">Laravel Valet</a> or anything else, you are comfortable with.</p><p>Due to my configuration, I’m gonna always refer to http://local.pingping.io:8080. You might have something different. For instance http://pingping.test or so.</p><p>A side note: These are the services I’m currently using at the time of writing this post.</p><pre>➜ services list</pre><pre>redis<br>memcached<br>php71<br>nginx<br>mysql<br>blackfire-agent<br>supervisor</pre><p>It’s not necessary, to use these. I just wanted to mention it for the sake of completeness. For now, we only need PHP &gt;= 7.0, a webserver (nginx or apache for instance) and MySQL as the database server. I also assume that you have the package manager composer already installed and are used to use it. It should also be in your path, so you can use it from everywhere in your file system.</p><h3>Creating a new project</h3><p>I create my new project in my home directory within a folder called Code as Valet does it. So let&#39;s create that directory, if it doesn&#39;t exist and cd into it from the terminal. And oh, I use of course <a href="https://www.iterm2.com/">iTerm2</a> for that. I prefer using the Laravel Installer. If you haven&#39;t it, just download the installer using composer.</p><pre>composer global require &quot;laravel/installer&quot;</pre><p>Make sure, the composer’s vendor bin directory is in your $PATH so the Laravel executable can be located. The cool thing about the installer is, that you can just use now laravel new to create a fresh Laravel installation within the specified directory. So in our case:</p><pre>laravel new pingping</pre><p>Alternatively you may also install Laravel using composer directly via</p><pre>composer create-project --prefer-dist laravel/laravel pingping</pre><p>At the time of writing this post, Laravel is at version 5.5.32.</p><h3>Pushing it up to GitHub</h3><p>As I told you, I build this project in public. Therefore I created an empty repository on GitHub, where you can follow the entire development process, collaborate with pull requests or just use the issues to track todos, ideas or bugs. You can find the repository at <a href="https://github.com/stefanbauer/pingping">https://github.com/stefanbauer/pingping</a>.</p><p>If you want to code along with me, you can use your own repository. The first thing I always do after installing a new project, I create a brand new local repository, commit the naked current state and push it to the remote repository to have a clean reference point. Actually I use always git-flow, as I am a big fan of it. But in this case I’m gonna stick with a simple master branch for now. Let’s cd into our pingping project directory.</p><pre>git init<br>git add .<br>git commit</pre><p>Now I enter as the commit message something like initial commit with naked Laravel 5.5.32 or so.</p><p>Oh and by the way. In the future I’m gonna to use my personal git aliases. If you’re interested in, have a look at <a href="https://stefanbauer.me/these-git-aliases-make-my-daily-work-faster-and-easier/">this post</a> here. To make getting started easier, I show you these details only in this post. In upcoming posts, I will just refer to things like <em>pushing</em>, <em>committing</em> or <em>rebasing</em>.</p><p>Then let’s push it up to the remote. First we have to add the remote. Usually this is called origin.</p><pre>git remote add origin git@github.com:stefanbauer/pingping.git</pre><p>After I have done that, we have to use for the very first time of pushing it up</p><pre>git push -u origin master</pre><p>instead of a simple git push. git push -u is the equivalent to git push --set-upstream. This is necessary to tell git, that you&#39;d like to push to the remote and enable tracking for this branch. Finally you have to add the remote name, where the branch should be pushed to and of course the name of the branch, which should be pushed.</p><p>That’s it. We are done with git. <strong>Congratulations!</strong></p><p>By the way: You can of course clone this project directly, if you don’t like to work along with me. But please don’t forget to install all the composer and yarn/npm dependencies.</p><pre>composer install<br>yarn install</pre><h3>Let’s do some basic setup</h3><p>Open the new project by using your editor of choice und let’s get started to do some basic setup.</p><h4>PHP Coding Standards Fixer</h4><p>For a couple of reasons, I use <strong>in every single project</strong> the <a href="https://github.com/FriendsOfPHP/PHP-CS-Fixer">PHP Coding Standards Fixer</a> which is a great tool. It fixes the code to the given standards. But one step at a time.</p><p>Short excursion: As soon as several team members are working on a project, I think it makes sense to use something like this. This ensures the same coding standard and code always looks identical. At least structurally. From my many years of experience I can confirm that such a tool is worth in any case.</p><p>I suggest you to install it globally via composer, like the Laravel Installer. So let’s do it.</p><pre>composer global require friendsofphp/php-cs-fixer</pre><p>You still have to make sure, same as with the Laravel Installer, that your Composer’s binaries directory is in your $PATH. But I guess, it should be meanwhile though. Anyways. If we type php-cs-fixer in the terminal, you should get information about the usage. If that happens, everything went well. If it doesn&#39;t work, there is a big chance, that you have to restart your terminal session, if you added the Composer&#39;s binary directory now and you forgot to source your bashrc/zshrc, or whatever shell you&#39;re using.</p><p>If that works for you, it’s time to create a little configuration file, that defines what our cs-fixer should take care about, which paths should be under control and what it needs to fix. Most people use as the main configuration rule the PSR-2 standard. For me personally, i&#39;ll go a little bit further and use the Symfony standard. It&#39;s on top of the PSR-2 with some more restrictions and some more settings that I find useful. Additionally to that default configuration, it is possible to override each option, which is set by the default setting. One of these setting I always change is the ordered_imports to the sortAlgorithm to length. What this does is, it orders the use statements by length and not by alphabet. But this comes down to your personal preference. It&#39;s up to you, if you like that or not.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/053953fbff19af1d6c7385e5700c5723/href">https://medium.com/media/053953fbff19af1d6c7385e5700c5723/href</a></iframe><p>In my environment setup, the cs-fixer runs immediatelly, when I save a file. So it can never ever happen, that I commit something, that does not fit the coding standards. Later, we’re gonna to use a tool like <a href="https://styleci.io/">StyleCI</a>. This tool reads our cs-fixer configuration and applies the changeset automatically via pull request. But one step at a time.</p><h4>Customizing the .gitignore</h4><p>For me, I don’t like the default .gitignore much for several reasons.</p><ul><li>Environment-specific files should not be ignored per project. The developer is responsible for this. Imagine you have a team of 10 developers and each developer is working with a different IDE. Should every developer ignore their IDE-dependent folders/files? This is the problem of the developer, not the project. In the worst case, you’ll end up with a ignore file that holds more IDE related entries than really project related entries.</li><li>I’m not a fan of defining what to ignore. I do always the opposite. Something like “Please ignore everything by default, unless I tell you explicitly that something should not be ignored!”.</li></ul><p>For now, let’s use the following .gitignore.</p><p>You might ask yourself, why the hell I ignore /public/*. The thing is, that we&#39;re using Laravel Mix and we really don&#39;t need anything in the public folder, but the index.php, the favicon.ico and the robots.txt for now. Everything else, will be copied over during our deployment process using Laravel Mix. Even the images are not necessary in my opinion. But let&#39;s keep it there for now and see where we&#39;re getting.</p><p><strong>A quick side note</strong>: I exclude composer.lock and phpunit.xml.</p><p>The reason for the composer.lock is, that when developing libraries, it&#39;s not necessarily recommended to commit the lock file. So I have the this file in my global gitignore. The reason for excluding the phpunit.xml is, that in general I think something like this and it might be, that we change that later together:</p><p>For a predefined phpunit.xml I would rename it to phpunit.xml.dist, like the .env.example (I would call it also .env.dist by the way). With that, you got always <em>distribution</em> files. You can of course work with exactly these files on your machine. Don&#39;t worries. But if you would like to have a different local configuration than your team mates, you can create your personal phpunit.xml and the phpunit.xml.dist will remain untouched. With that in mind, it is possible that every single team mate could have it&#39;s own phpunit configuration without any hassle.</p><p>But you know what? Let’s do it now.</p><h4>Renaming phpunit.xml</h4><p>Here is nothing much to say. I will rename the phpunit.xml to phpunit.xml.dist behind the scenes and we&#39;re good to go. We&#39;re gonna customize this file later, if we need to. But the cool thing is now, that if in this distribution file is used mysql for instance, you can create your own local version with in-memoery sqlite database, without taking care if you are safe to to push that phpunit.xml(.dist) file or not.</p><h4>Renaming .env.example</h4><p>So that everything is done right away, we also rename the .env.example to .env.dist. Cool!</p><h3>Pushing up the changes</h3><p>Now that we’ve changed some files and modified the .gitignore, there are also some new files to track. Add it, commit it and push it.</p><pre>git add .<br>git commit<br>git push</pre><h3>What’s next?</h3><p>For today we’re done. Actually, to be honest, my plan was to integrate TailwindCSS in this episode and start with the the first frontend topic — the Login. Just because I think there’s nothing better than seeing immediate results.</p><p>Anyways, now I told you not only what I did and copied some code, I also told you why I did things like I did it and what my experience is in different situations. So if you have any questions about that, let me know on Twitter or shoot me a mail. In the next episode we will really start to integrate TailwindCSS and the Login. Keep on coding!</p><p>If you would like to join me, <a href="https://stefanbauer.me/building-pingping/">sign up now</a>, follow <a href="https://twitter.com/stefanbauerme">me</a> and <a href="https://twitter.com/pingpingapp">@pingpingapp</a> on Twitter.</p><p><em>If you enjoyed this article, please help out your friends with a</em> 💙<em> or a share.</em></p><p><em>I am </em><a href="https://medium.com/u/1ec63c5cf4c9"><em>Stefan Bauer</em></a><em>, a Developer, Team-Leader, UI/UX Enthusiast and Bacon-Lover located Germany, Munich. I love PHP, Laravel and great UI.</em></p><p><strong><em>I’m building </em></strong><a href="https://twitter.com/pingpingapp"><strong><em>PingPing.io</em></strong></a><strong><em>, a free, open source and easy to use monitoring SaaS Application for everyone in public. If you like, </em></strong><a href="https://stefanbauer.me/building-pingping/"><strong><em>we can build it together</em></strong></a><strong><em>. You can follow me on </em></strong><a href="https://twitter.com/stefanbauerme"><strong><em>Twitter</em></strong></a><strong><em> to be part of my daily work.</em></strong></p><p><em>Originally published at </em><a href="https://stefanbauer.me/building-pingping/lets-get-the-ball-rolling/"><em>stefanbauer.me</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b51ffaf806d8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[001: A simple SaaS monitoring product in Laravel, VueJS and TailwindCSS]]></title>
            <link>https://medium.com/@stefanbauer/building-pingping-a-simple-saas-monitoring-product-in-laravel-vuejs-and-tailwindcss-ac55e0ca97d4?source=rss-1ec63c5cf4c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac55e0ca97d4</guid>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[saas]]></category>
            <dc:creator><![CDATA[Stefan Bauer]]></dc:creator>
            <pubDate>Fri, 12 Jan 2018 07:03:06 GMT</pubDate>
            <atom:updated>2018-02-25T10:26:57.155Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*RxiXtdixwCNhlkZYYIUpxQ.png" /></figure><p><a href="https://medium.com/u/2bdb4734b294">Adam Wathan</a> (<a href="https://twitter.com/adamwathan">Twitter</a>) and <a href="https://twitter.com/jeffrey_way">Jeffrey Way</a> from <a href="https://medium.com/u/d163b3776f15">Laracasts</a> inspired me to build a new product. I’m totally excited about their ability to teach other developers. I consume a lot of knowledge on the Internet. But now I decided to give something back to the community. That’s why I started looking for a product. A product that makes fun to build and at the same time useful.</p><p>You know what the best part is? You and I will build this product together. Step by step. You’re gonna keep looking over my shoulders.</p><h3>Brainstorming</h3><p>I’ve been thinking long and hard. I’ve already built a lot of websites. Many independent products for intranets. I have also been building SaaS accounting software for over 3 years. So I need something new. But what?</p><p>In fact, I’ve been considering building a billing software with you again. From my many years of experience, however, I can say that this product is a “bottomless barrel”. At least if you develop it in the depths what I did. Orders, letters, invoices, stock management, dunning, shop connection, and much more. After that I was busy for quite a long time with the idea to develop a small helpdesk system. I even already had a domain for it. <strong>tinydesk.co.</strong> I love this domain. Maybe we’ll do it another time. Why don’t we start this project? Well. I already built a SaaS helpdesk variant more than 10 years ago. Probably one of the first on the market. Same here, the complexity should not be underestimated.</p><p>It is important to me that we find a product together with which you feel comfortable. That you can identify with. It is important that you understand the domain of this product. Only then can you constantly follow me and understand why we do things the way we do them.</p><p>Then one night, I had the idea. Often it annoys me that I don’t notice, or only too late, that one of my websites is offline. Of course there are already some products on the market. Pingdom, UpDown, UptimeMonitor, and many more. But everyone has a disadvantage. They are expensive and have more features than I actually need. And so the idea was born. A product that allows me to “ping” any number of websites. I get a notification as soon as a page is offline. No more, no less. And all that with a beautiful designed UI.</p><h3>The product</h3><p>So we build a product that is able to “ping” our websites. A product that informs us when our pages are offline. Pretty cool. We want to make it as simple as possible. We just want to restrict it to the essential features. Don’t build features that nobody needs. There must be a name. A name, that is easy to remember. And after we “ping” websites, I decided to call it simple <a href="https://twitter.com/pingpingapp">PingPing</a>. I like it!</p><h3>The Logo</h3><p>I already built a logo. It combines the letter “P” of <a href="https://twitter.com/pingpingapp">PingPing</a> with the idea of a chart. Like a up and down chart. I hope you like it! Let me know, what you think.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*-TEHnL3pse2Scd9w.png" /><figcaption>The Logo of “PingPing”</figcaption></figure><h3>The first features</h3><p>In order to stay focused, I’ve already written some points together, which in any case have to be put into our first version, so that <a href="https://twitter.com/pingpingapp">PingPing</a> deserves its name:</p><ul><li>Login</li><li>Create/edit/delete web pages</li><li>Determination of ping criteria (frequency, pausing)</li><li>Ping web pages (online/offline status, Response times)</li><li>Notifications via e-mail in case of status change</li></ul><h3>What else do we need</h3><p>Since I’m not sure yet if I want to distribute the product commercially, we’ll probably also build the marketing page together. The first landing page to get some email addresses. And then the finished page with all relevant information.</p><h3>The technology</h3><p>Now the most exciting information for all of you. Which technologies will we work with? I don’t need to write it any more complicated than it is. We rely on the <a href="https://medium.com/u/d694c31ce941">Taylor Otwell</a>’s <a href="https://laravel.com/">Laravel</a> framework. In the frontend we will use <a href="https://medium.com/u/4f198f5f1f12">Evan You</a>’s <a href="https://vuejs.org/">VueJS</a> and <a href="https://medium.com/u/2bdb4734b294">Adam Wathan</a>’s <a href="https://tailwindcss.com/">TailwindCSS</a>. I can promise you one thing right now. It’s gonna be really cool. I’ve been working a little bit ahead of you:)</p><p>By the way: I will try to build up the whole product with you “Test-Driven”. From A-Z. From front to back.</p><h3>And otherwise?</h3><p>Actually, that’s it! The only thing I have to say is this:</p><p>If you would like to join me, sign up now, follow <a href="https://twitter.com/stefanbauerme">me personally</a> and <a href="https://twitter.com/pingpingapp">@pingpingapp</a> on Twitter and be excited about the first post, when it says “Let’s get the ball rolling”.</p><p><em>If you enjoyed this article, please help out your friends with a</em> 💙<em> or a share.</em></p><p><em>I am </em><a href="https://medium.com/u/1ec63c5cf4c9"><em>Stefan Bauer</em></a><em>, a Developer, Team-Leader, UI/UX Enthusiast and Bacon-Lover located Germany, Munich. I love PHP, Laravel and great UI.</em></p><p><strong><em>I’m building </em></strong><a href="https://twitter.com/pingpingapp"><strong><em>PingPing.io</em></strong></a><strong><em>, a easy to use monitoring SaaS Application for everyone. If you like, </em></strong><a href="https://stefanbauer.me/building-pingping/"><strong><em>we can build it together</em></strong></a><strong><em>. You can follow me on </em></strong><a href="https://twitter.com/stefanbauerme"><strong><em>Twitter</em></strong></a><strong><em> to be part of my daily work. You should also </em></strong><a href="https://stefanbauer.me/newsletter/"><strong><em>subscribe to my newsletter</em></strong></a><strong><em>. I will share everything i know</em></strong></p><p><em>Originally published at </em><a href="https://stefanbauer.me/building-pingping/what-we-are-gonna-build/"><em>stefanbauer.me</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac55e0ca97d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why I switched from Wordpress to Jigsaw]]></title>
            <link>https://medium.com/@stefanbauer/why-i-switched-from-wordpress-to-jigsaw-ab692bbcbfb1?source=rss-1ec63c5cf4c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab692bbcbfb1</guid>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[blog]]></category>
            <dc:creator><![CDATA[Stefan Bauer]]></dc:creator>
            <pubDate>Sun, 07 Jan 2018 00:30:03 GMT</pubDate>
            <atom:updated>2018-01-24T01:43:55.883Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c0HNJbL6_phSqAAUzpqb_g.jpeg" /></figure><p>People who know me, know, that i started more than once a blog and just wrote under ten posts in the blog lifetime. The reason was, that i didn’t have enough time. I used different backends for it. Everything that is out there. Here some examples:</p><ul><li>Wordpress</li><li>Plain HTML</li><li>Jekyll</li><li>Self-Written</li><li>Ghost</li><li>Tumblr</li><li>Blogspot</li></ul><h3>How I came to Jigsaw</h3><p>Some time ago, Iwas in contact with <a href="https://adamwathan.me/">Adam Wathan</a> regarding different things and somehow we began to talk about <a href="http://jigsaw.tighten.co/">Jigsaw</a>, a static site generator from Tighten Co, the company where Adam was working before.</p><p>Anyways. I had a look at the documentation and was really impressed. If you know, how much blog systems I tried, you also know it’s very hard to impress me. So I read the documentation and thought from page to page, that this seems to be the tool I would like to use. It has exactly everything I need, that i missed in any different system.</p><ul><li>Easy to install</li><li>Modify to my needs</li><li>Use Markdown</li><li>Easy Deployment</li></ul><p>Let me explain, what I mean by these things:</p><p>The best system I found so far, was Jekyll. If it is running, it is cool. But until it is running, it is so messy. You have to use this ruby and bundler stuff. I hate it! Wrong version here, wrong version there. Terrible. For me it was important, that it is really easy to install, flexible as possible, easy to modify, not hosted on another platform and easy to use. Setup in under 5 minutes, so to speak.</p><p>With Jigsaw you need nothing. Really! You just need to pull in a package into your composer file with composer require tightenco/jigsaw. Done! What I really like is, that it is very easy to use if you are familiar with Laravel. It uses some of their components and it feels very good. Working as you are used to.</p><p>Out of the box, there is Laravel’s default template engine “Blade” for handling the template stuff, Laravel’s “Elixir” (may be will be replaced with mix by default?) for handling the frontend SCSS stuff and a lot more. What really cool is, that you can define different environments. That makes deployment very easy. And in my case I use <a href="https://forge.laravel.com/">Laravel Forge</a> for server provisioning and deployment. It’s just beautiful.</p><p>What the cool thing is: It took me exactly one day to setup <a href="https://stefanbauer.me/">my blog</a>, to create a complete easy theme and to start writing the very first blog post. If you are interested in, how I did it exactly from scratch, how my workflow was, let me know. Maybe it is worth to create a full series about creating the blog from zero to now.</p><h3>The Adam Wathan’s inspired Theme</h3><p>Everybody knows, I’m a big fan of simplicity. Therefore it does not surprise anyone that I like Adam’s Blog Style. I decided to create a similar one, inspired by his beautiful created one. Just with some differences i like better. I don’t make any secret about, that i use different pages for getting ideas and inspirations. Nobody reinvents the wheel.</p><h3>Using Laravel Mix instead of Laravel Elixir</h3><p>Meanwhile, Laravel Elixir is outdated and with my <a href="https://twitter.com/pingpingapp">PingPing Project</a>, a SaaS Monitoring (<a href="https://stefanbauer.me/building-pingping/">what we could build together if you like</a>), I love using <a href="https://tailwindcss.com/">TailwindCSS</a>. Therefore I decided to pull in TailwindCSS and use Laravel Mix instead of Laravel Elixir. If you have some troubles to use Laravel Mix in Jigsaw, let me show you my webpack.mix.js.</p><pre>const argv = require(&#39;yargs&#39;).argv<br>const command = require(&#39;node-cmd&#39;)<br>const mix = require(&#39;laravel-mix&#39;)<br>const OnBuild = require(&#39;on-build-webpack&#39;)<br>const Watch = require(&#39;webpack-watch&#39;)<br>const tailwind = require(&#39;tailwindcss&#39;)</pre><pre>const env = argv.e || argv.env || &#39;local&#39;<br>const plugins = [<br>    new OnBuild(() =&gt; {<br>        command.get(&#39;./vendor/bin/jigsaw build &#39; + env, (error, stdout, stderr) =&gt; {<br>            if (error) {<br>                console.log(stderr)<br>                process.exit(1)<br>            }<br>            console.log(stdout)<br>        })<br>    }),<br>    new Watch({<br>        paths: [&#39;source/**/*.md&#39;, &#39;source/**/*.php&#39;],<br>        options: { ignoreInitial: true }<br>    }),<br>]</pre><pre>mix.webpackConfig({ plugins })<br>mix.setPublicPath(&#39;source&#39;)</pre><pre>mix<br>    .js(&#39;source/_assets/js/app.js&#39;, &#39;source/js&#39;)<br>    .less(&#39;source/_assets/less/main.less&#39;, &#39;source/css&#39;)<br>    .options({<br>        postCss: [<br>            tailwind(&#39;tailwind.js&#39;),<br>        ]<br>    })<br>    .browserSync({<br>        port: 8000,<br>        server: { baseDir: &#39;build_&#39; + env },<br>        proxy: null,<br>        files: [<br>            &#39;build_&#39; + env + &#39;/**/*&#39;<br>        ]<br>    })<br>    .disableNotifications()</pre><p><em>If you enjoyed this article, please help out your friends with a</em> 💙<em> or a share.</em></p><p><em>I am </em><a href="https://medium.com/u/1ec63c5cf4c9"><em>Stefan Bauer</em></a><em>, a Developer, Team-Leader, UI/UX Enthusiast and Bacon-Lover located Germany, Munich. I love PHP, Laravel and great UI.</em></p><p><strong><em>I’m building </em></strong><a href="https://twitter.com/pingpingapp"><strong><em>PingPing.io</em></strong></a><strong><em>, a easy to use monitoring SaaS Application for everyone. If you like, </em></strong><a href="https://stefanbauer.me/building-pingping/"><strong><em>we can build it together</em></strong></a><strong><em>. You can follow me on </em></strong><a href="https://twitter.com/stefanbauerme"><strong><em>Twitter</em></strong></a><strong><em> to be part of my daily work. You should also </em></strong><a href="https://stefanbauer.me/newsletter/"><strong><em>subscribe to my newsletter</em></strong></a><strong><em>. I will share everything I know</em></strong></p><p><em>Originally published at </em><a href="https://stefanbauer.me/why-i-switched-from-wordpress-to-jigsaw/"><em>stefanbauer.me</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab692bbcbfb1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using separated Commands and CommandHandlers]]></title>
            <link>https://medium.com/@stefanbauer/using-separated-commands-and-commandhandlers-3f2ee754a2a3?source=rss-1ec63c5cf4c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f2ee754a2a3</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[laravel]]></category>
            <dc:creator><![CDATA[Stefan Bauer]]></dc:creator>
            <pubDate>Thu, 02 Nov 2017 17:00:26 GMT</pubDate>
            <atom:updated>2018-01-07T00:31:32.140Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XJZYcWBGm9ZBESDZvUO--g.png" /></figure><p>For me personally, i don’t like the Jobs much. For me it is more logical if the commands and the handlers are separate. I also don’t like injecting the dependencies in the handle() method of the selfhandling jobs. I like the common command bus design where you have a command and a handler that handles that command.</p><p>Here i would like to show you a very easy way, how you can continue working with dedicated commands and command handlers as you did in some versions before with the regular command bus. Here we go:</p><h3>Create a command</h3><p>To keep it very simple, i will just create some demo code to show you the basics.</p><pre>&lt;?php<br><br>declare(strict_types=1);<br><br>namespace App\Domain\User\Command;<br><br>final class RegisterUserCommand<br>{<br>    public $username;<br><br>    public function __construct(string $username)<br>    {<br>        $this-&gt;username = $username;<br>    }<br>}</pre><h3>Create the corresponding command handler</h3><p>After you created your command, it is time to create the command handler that handles that command.</p><pre>&lt;?php<br><br>declare(strict_types=1);<br><br>namespace App\Domain\User\Command;<br><br>final class RegisterUserCommandHandler<br>{<br>    public function handle(RegisterUserCommand $command)<br>    {<br>        // create user, dispatch event, or whatever necessary<br>        return &#39;user created with username &#39;.$command-&gt;username;<br>    }<br>}</pre><h3>Time to connect them</h3><p>Now that we have the command it self and the handler that should handle the command, we have to tell the dispatcher which handler is responsible for which command. Easy! There are several ways to do that. The easiest way is that you use a ServiceProvider for it or use the already existing AppServiceProvider.</p><p>Either you fetch the current Dispatcher out of the IoC directly or you just inject it into the boot() method. I will show you both methods. After you resolved the Dispatcher, you use the map() method to map the command to the command handler.</p><h4>Resolving directly out of the IoC</h4><pre>&lt;?php<br><br>namespace App\Providers;<br><br>use App\Domain\User\Command\RegisterUserCommand;<br>use App\Domain\User\Command\RegisterUserCommandHandler;<br>use Illuminate\Support\ServiceProvider;<br><br>class AppServiceProvider extends ServiceProvider<br>{<br>    public function boot()<br>    {<br>        $dispatcher = $this-&gt;app-&gt;make(\Illuminate\Contracts\Bus\Dispatcher::class);<br>        $dispatcher-&gt;map([<br>            RegisterUserCommand::class =&gt; RegisterUserCommandHandler::class,<br>        ]);<br>    }<br>   <br>    // register() method...   <br>   <br>}</pre><h4>or using DI</h4><pre>&lt;?php<br><br>namespace App\Providers;<br><br>use App\Domain\User\Command\RegisterUserCommand;<br>use App\Domain\User\Command\RegisterUserCommandHandler;<br>use Illuminate\Bus\Dispatcher;<br>use Illuminate\Support\ServiceProvider;<br><br>class AppServiceProvider extends ServiceProvider<br>{<br>    public function boot(Dispatcher $dispatcher)<br>    {<br>        $dispatcher-&gt;map([<br>            RegisterUserCommand::class =&gt; RegisterUserCommandHandler::class,<br>        ]);<br>    }<br><br>    // register() method....   <br><br>}</pre><h3>We should try it</h3><p>Let’s give it a shot and try it. We use the route file directly to test that. Like so:</p><pre>Route::get(&#39;dispatch&#39;, function(\Illuminate\Bus\Dispatcher $dispatcher) {<br>    return \Bus::dispatch(new \App\Domain\User\Command\RegisterUserCommand(&#39;my-username&#39;));<br>});</pre><p>If you go now to the browser you should see something like “<em>user created with username my-username</em>“.</p><p><em>Originally published at </em><a href="https://stefanbauer.me/using-separated-commands-and-commandhandlers/"><em>stefanbauer.me</em></a><em> on November 2, 2017.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f2ee754a2a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>