<?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: Wilbur Powery </title>
    <description>The latest articles on DEV Community by Wilbur Powery  (@wilburpowery).</description>
    <link>https://dev.to/wilburpowery</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%2F16528%2Fa3e0ed8b-e0de-420f-a601-64398f2e644a.jpg</url>
      <title>DEV Community: Wilbur Powery </title>
      <link>https://dev.to/wilburpowery</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/wilburpowery"/>
    <language>en</language>
    <item>
      <title>Easily Upgrade to PHP 7.3</title>
      <dc:creator>Wilbur Powery </dc:creator>
      <pubDate>Sat, 22 Dec 2018 00:00:00 +0000</pubDate>
      <link>https://dev.to/wilburpowery/easily-upgrade-to-php-73-bdo</link>
      <guid>https://dev.to/wilburpowery/easily-upgrade-to-php-73-bdo</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzdxzzru6si5crf98ax8u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzdxzzru6si5crf98ax8u.png" alt="Thumbnail" width="800" height="221"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First published on my &lt;a href="https://wilburpowery.co/posts/easily-upgrade-to-php-73/" rel="noopener noreferrer"&gt;website&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;PHP 7.3 has been out for a couple of weeks now and if you're interested in upgrading, the process is super simple.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This small guide if meant for Mac OS users. If you're a Windows user, a quick google search should help you out!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Let's update everything
&lt;/h2&gt;

&lt;p&gt;To pull install or update any applications or services, I use a Mac OS package manager called &lt;a href="https://brew.sh/" rel="noreferrer noopener"&gt;Homebrew&lt;/a&gt;. Before we go about upgrading our PHP installation, lets' quickly run a Homebrew commands to update our formulae and Homebrew itself.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Upgrading PHP
&lt;/h3&gt;

&lt;p&gt;Now that our formulae is updated, we can proceed to upgrade our PHP installation with the latest version available on Homebrew.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;brew upgrade php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the upgrade completes, you can open a new tab in your terminal and check your PHP version with &lt;code&gt;php -v&lt;/code&gt;. If all went well, you should see something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;PHP 7.3.0 &lt;span class="o"&gt;(&lt;/span&gt;cli&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;built: Dec  7 2018 11:00:11&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt; NTS &lt;span class="o"&gt;)&lt;/span&gt;
Copyright &lt;span class="o"&gt;(&lt;/span&gt;c&lt;span class="o"&gt;)&lt;/span&gt; 1997-2018 The PHP Group
Zend Engine v3.3.0-dev, Copyright &lt;span class="o"&gt;(&lt;/span&gt;c&lt;span class="o"&gt;)&lt;/span&gt; 1998-2018 Zend Technologies
    with Zend OPcache v7.3.0, Copyright &lt;span class="o"&gt;(&lt;/span&gt;c&lt;span class="o"&gt;)&lt;/span&gt; 1999-2018, by Zend Technologies
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In only a couple of minutes, you're already upgraded to the latest version of PHP. Keep in mind that some packages or services you're using in your system or applications might not be updated just yet to work on PHP 7.3.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus for Laravel users
&lt;/h2&gt;

&lt;p&gt;If you're a Laravel user you're more than likely using Laravel Valet. In order to get Valet working on PHP 7.3, you simply need to update it to the latest version released. Just do a &lt;code&gt;composer global update&lt;/code&gt; to update all your globally installed Composer packages and then just do a &lt;code&gt;valet install&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Running &lt;code&gt;valet install&lt;/code&gt; again is necesarry to configure the installation to work with your new PHP version.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; There are some known bugs with PHP 7.3 and Opcache when queueing emails in the Laravel framework so I encourage you to keep an eye on the issues in the Laravel repository on &lt;a href="https://github.com/laravel/framework/issues/26819" rel="noreferrer noopener"&gt;Github&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>php</category>
    </item>
    <item>
      <title>Work Hard / Play Harder</title>
      <dc:creator>Wilbur Powery </dc:creator>
      <pubDate>Thu, 22 Nov 2018 00:17:06 +0000</pubDate>
      <link>https://dev.to/wilburpowery/work-hard--play-harder-2o2o</link>
      <guid>https://dev.to/wilburpowery/work-hard--play-harder-2o2o</guid>
      <description>&lt;p&gt;Want something? Work for it. Nobody owes you anything!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkyt1trherg0t9hm54djk.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkyt1trherg0t9hm54djk.JPG" width="800" height="1422"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>motivation</category>
    </item>
    <item>
      <title>Easily use UUIDs in Laravel</title>
      <dc:creator>Wilbur Powery </dc:creator>
      <pubDate>Mon, 29 Oct 2018 00:00:00 +0000</pubDate>
      <link>https://dev.to/wilburpowery/easily-use-uuids-in-laravel-45be</link>
      <guid>https://dev.to/wilburpowery/easily-use-uuids-in-laravel-45be</guid>
      <description>&lt;p&gt;First published on my &lt;a href="https://wilburpowery.co/posts/easy-uuids-in-laravel/"&gt;website&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What are UUIDs?
&lt;/h2&gt;

&lt;p&gt;UUID stands for &lt;strong&gt;Universal Unique Identifier&lt;/strong&gt;. It's a 128-bit number used to uniquely identify some object or in our case, a record in our database.&lt;/p&gt;

&lt;p&gt;I won't go into depth about the pros or cons of UUIDs when compared to a regular auto incrementing ID, that's an entire blog post of its own. What I will do, is show you how easy it is to use UUIDs in your Laravel application if you wish too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prepare your migration
&lt;/h2&gt;

&lt;p&gt;The first step of using UUIDs in your database is setting up your column to be of a specific type. By default, a Laravel migration includes a &lt;code&gt;$table-&amp;gt;primary('id');&lt;/code&gt; column in each migration you create.&lt;/p&gt;

&lt;p&gt;Using UUIDs is as simple as updating our migration to use the &lt;code&gt;-&amp;gt;uuid()&lt;/code&gt; method that Laravel provides out of the box for us. For example, let's say we're creating a migration to describe the schema of a Post.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nx"&gt;Schema&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'posts'&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="nx"&gt;Blueprint&lt;/span&gt; &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;uuid&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'id'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;primary&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'title'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'body'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;timestamps&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 important line you should notice is this one: &lt;code&gt;$table-&amp;gt;uuid('id')-&amp;gt;primary();&lt;/code&gt;. Notice we are using the &lt;code&gt;uuid()&lt;/code&gt; method instead of the common &lt;code&gt;increments()&lt;/code&gt; method. As you can see, the &lt;code&gt;uuid()&lt;/code&gt; method specifies the column should be a UUID equivalent column and we also specify that  it should be the primary key on the table.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating the UUID
&lt;/h2&gt;

&lt;p&gt;If you run &lt;code&gt;php artisan migrate&lt;/code&gt;, and try to create a new record using something like a factory, or manually creating it, you'll run into an error saying the &lt;code&gt;id&lt;/code&gt; column cannot be null.&lt;/p&gt;

&lt;p&gt;When using the &lt;code&gt;primary()&lt;/code&gt; method on our migrations, Laravel will notice it's an auto-incrementing column and whip it up for us. But, since we switched over to using UUIDs, we'll need to create the ID ourselves. &lt;/p&gt;

&lt;h3&gt;
  
  
  Use Eloquent Model Events
&lt;/h3&gt;

&lt;p&gt;Since you're using Laravel, I imagine you would also be using Eloquent to easily interact with your database. &lt;/p&gt;

&lt;p&gt;Eloquent has what are known as Model Events. In total, it fires a total of 11 events in different scenarios. You have  the following events: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;retrieved&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;creating&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;created&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;updating&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;updated&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;saving&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;saved&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;deleting&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;deleted&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;restoring&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;restored&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to learn more about Eloquent Events, you can find their documentation &lt;a href="https://laravel.com/docs/5.7/eloquent#events"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now, back to creating our UUIDs. Let's take a look at how your &lt;code&gt;Post&lt;/code&gt; model could look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Post&lt;/span&gt; &lt;span class="k"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;Model&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="nv"&gt;$guarded&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt; &lt;span class="c1"&gt;// YOLO&lt;/span&gt;

    &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;boot&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;parent&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;boot&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

        &lt;span class="k"&gt;static&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;creating&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="nv"&gt;$post&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nv"&gt;$post&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;$post&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getKeyName&lt;/span&gt;&lt;span class="p"&gt;()}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;Str&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;uuid&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getIncrementing&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getKeyType&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s1"&gt;'string'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Our Model has 3 methods in it. The &lt;code&gt;boot&lt;/code&gt; method is where we can hook into our model and listen for any Eloquent events. The &lt;code&gt;getIncrementing&lt;/code&gt; method is used by Eloquent to now if the IDs on the table are incrementing. Remember we are using UUIDs so we set auto incrementing to &lt;code&gt;false&lt;/code&gt;.&lt;br&gt;
Lastly, the &lt;code&gt;getKeyType&lt;/code&gt; method just specifies that the IDs on the table should be stored as strings.&lt;/p&gt;

&lt;p&gt;In our &lt;code&gt;boot&lt;/code&gt; method, we are listening for the &lt;code&gt;creating&lt;/code&gt; Eloquent event. This even is fired just before the record is actually stored in the database. We hook into this event, and use the &lt;code&gt;uuid()&lt;/code&gt; method provided by the &lt;code&gt;Str&lt;/code&gt; class in Laravel.&lt;/p&gt;

&lt;p&gt;A while ago, people might have installed a package with Composer in order to generate a UUID but you can generate them easily using the &lt;code&gt;uuid()&lt;/code&gt; method provided by the class.&lt;/p&gt;

&lt;p&gt;Easy as that, you can use UUIDs in Laravel. &lt;/p&gt;

&lt;p&gt;As I final note, I'll usually have a PHP trait called &lt;code&gt;UsesUuid&lt;/code&gt; where I'll have the logic above. That way I wouldn't repeated the code on every model I wanted to use UUIDs.&lt;/p&gt;

&lt;p&gt;This is what the &lt;code&gt;UsesUuid&lt;/code&gt; trait would look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;

&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;App\Models\Concerns&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nn"&gt;Illuminate\Support\Str&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;trait&lt;/span&gt; &lt;span class="nc"&gt;UsesUuid&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;bootUsesUuid&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;static&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;creating&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="nv"&gt;$model&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="nv"&gt;$model&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getKey&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="nv"&gt;$model&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;$model&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;getKeyName&lt;/span&gt;&lt;span class="p"&gt;()}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;Str&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="na"&gt;uuid&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getIncrementing&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getKeyType&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s1"&gt;'string'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Notice how everything is more generalized and not tied to a unique model.&lt;/p&gt;

&lt;p&gt;Now, in any model that as the correct column in its migration you can simply use the &lt;code&gt;UsesUuid&lt;/code&gt; trait like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Post&lt;/span&gt; &lt;span class="k"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;Model&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nn"&gt;App\Models\Concerns\UsesUuid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="nv"&gt;$guarded&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt; &lt;span class="c1"&gt;// YOLO&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;That's it. In just a few simple steps you got UUIDs working in your Laravel app.&lt;/p&gt;

</description>
      <category>php</category>
      <category>laravel</category>
      <category>uuids</category>
    </item>
    <item>
      <title>My Personal Website | Blog</title>
      <dc:creator>Wilbur Powery </dc:creator>
      <pubDate>Thu, 30 Aug 2018 15:34:27 +0000</pubDate>
      <link>https://dev.to/wilburpowery/my-personal-website--blog-3dmj</link>
      <guid>https://dev.to/wilburpowery/my-personal-website--blog-3dmj</guid>
      <description>&lt;p&gt;The little I know about design came from following Steve Schoger on Twitter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/steveschoger"&gt;https://twitter.com/steveschoger&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My site =&amp;gt; &lt;a href="https://wilburpowery.co/"&gt;https://wilburpowery.co/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'd like to know your thoughts on my site 🤗&lt;/p&gt;

</description>
      <category>website</category>
      <category>php</category>
      <category>jigsaw</category>
      <category>tightenco</category>
    </item>
    <item>
      <title>Async + Await refactor, which do you like best?</title>
      <dc:creator>Wilbur Powery </dc:creator>
      <pubDate>Fri, 18 May 2018 18:08:19 +0000</pubDate>
      <link>https://dev.to/wilburpowery/async--await-refactor-which-do-you-like-best-66j</link>
      <guid>https://dev.to/wilburpowery/async--await-refactor-which-do-you-like-best-66j</guid>
      <description>&lt;blockquote data-lang="en"&gt;
&lt;p&gt;Async + Await is sooo good once you get the hang of it. Just refactored this piece of code and removed a lot of indentation levels. Removing indentation levels is always good. &lt;a href="https://twitter.com/hashtag/javascript?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#javascript&lt;/a&gt; &lt;a href="https://twitter.com/hashtag/es6?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#es6&lt;/a&gt; &lt;a href="https://t.co/zfFEDyJU0B"&gt;pic.twitter.com/zfFEDyJU0B&lt;/a&gt;&lt;/p&gt;— Wilbur Powery (&lt;a class="mentioned-user" href="https://dev.to/wilburpowery"&gt;@wilburpowery&lt;/a&gt;
) &lt;a href="https://twitter.com/wilburpowery/status/997281352910278656?ref_src=twsrc%5Etfw"&gt;May 18, 2018&lt;/a&gt;
&lt;/blockquote&gt;

</description>
      <category>javascript</category>
      <category>es6</category>
      <category>promises</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Resolve classes from Laravel's Container</title>
      <dc:creator>Wilbur Powery </dc:creator>
      <pubDate>Thu, 17 May 2018 13:08:22 +0000</pubDate>
      <link>https://dev.to/wilburpowery/resolve-classes-from-laravels-container-1lf4</link>
      <guid>https://dev.to/wilburpowery/resolve-classes-from-laravels-container-1lf4</guid>
      <description>&lt;p&gt;&lt;a href="https://wilburpowery.co/posts/dependency-injection-with-laravel-container/"&gt;First published on my website&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Laravel's Container
&lt;/h1&gt;

&lt;p&gt;Laravel's Container is without a doubt one of the most powerful tools provided by the framework. If you've ever used Laravel before, you've used the service Container without even knowing it. Behind the scenes Laravel resolves all your controller classes from the Container, that's the reason you can type hint any class and get an instance really easily.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resolving a class from the Container
&lt;/h2&gt;

&lt;p&gt;Resolving a class from the Container is very easy with Laravel and there is actually a few ways it can be done. Choose whichever you like best, and stick with it.&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;// Using the App Facade&lt;/span&gt;
&lt;span class="nc"&gt;App&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;make&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Slack\Api'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Using the app helper function&lt;/span&gt;
&lt;span class="nf"&gt;app&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Slack\Api'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Using the resolve helper function&lt;/span&gt;
&lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Slack\Client'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





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

&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;Slack&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Api&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;__construct&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Class&lt;/span&gt; &lt;span class="nv"&gt;$dependency&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;dependency&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$dependency&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The Container will notice there's a type hint in our constructor and it will try to resolve that dependency and pass it into the class.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Not all dependencies will be resolvable by the Container
&lt;/h2&gt;

&lt;p&gt;What if there's a dependency that can't (or shouldn't) be solved by the Container? Well, you can pass an array as the second parameter with any data that should be sent to the class.&lt;/p&gt;

&lt;p&gt;To get a better idea of where this would be necessary, let's explore a real open source poject. We'll use a package I discovered a few weeks ago,  &lt;a href="https://github.com/calebporzio/onboard"&gt;Onboard&lt;/a&gt;, created by &lt;a href="https://twitter.com/calebporzio"&gt;@calebporzio&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Let's take a look at at the &lt;code&gt;OnboardingManager&lt;/code&gt; class, specifically the constructor:&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="cp"&gt;&amp;lt;?php&lt;/span&gt;

&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;Calebporzio\Onboard&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;OnboardingManager&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="cd"&gt;/**
    * Create the Onboarding Manager (should always be a singleton).
    *
    * @param mixed $user The parent app's user model.
    * @param \Calebporzio\Onboard\OnboardingSteps $onboardingSteps
    */&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;__construct&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;OnboardingSteps&lt;/span&gt; &lt;span class="nv"&gt;$onboardingSteps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;steps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$onboardingSteps&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;steps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$user&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;// rest of class method...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice how we aren't type hinting the &lt;code&gt;$user&lt;/code&gt; dependency, so the Container wouldn't know how to fetch this dependency for us. Instead, we'll need to pass it in when resolving the class from the Container.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's resolve the class from the Container
&lt;/h2&gt;

&lt;p&gt;The package has a &lt;code&gt;GetsOnboarded&lt;/code&gt; trait that you can use in your User model, it has just an &lt;code&gt;onboarding&lt;/code&gt; method.&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="cp"&gt;&amp;lt;?php&lt;/span&gt;

&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;Calebporzio\Onboard&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Support\Facades\App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="cd"&gt;/**
 * This is the trait to be added to the app's User class.
 */&lt;/span&gt;
&lt;span class="kd"&gt;trait&lt;/span&gt; &lt;span class="nc"&gt;GetsOnboarded&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="cd"&gt;/**
    * This provides a pathway for the package's API
    *
    * @return \Calebporzio\Onboard\OnboardingManager $onboarding
    */&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;onboarding&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;App&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;make&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;OnboardingManager&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'user'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice how we're using the &lt;code&gt;App&lt;/code&gt; Facade to resolve the class from the Container so that the type hinted &lt;code&gt;OnboardingSteps&lt;/code&gt; dependency gets passed in, but we manually pass in the value for the &lt;code&gt;$user&lt;/code&gt; dependency.&lt;/p&gt;

&lt;p&gt;For readability Laravel also offers an alias to the &lt;code&gt;App::make&lt;/code&gt; method called &lt;code&gt;makeWith&lt;/code&gt; which simply calls the &lt;code&gt;make&lt;/code&gt; method behind the scenes.&lt;/p&gt;




&lt;p&gt;Know you can start resolving classes from the Container and have all their dependencies resolved automatically for you. You have many ways to access the Container, using the &lt;code&gt;App&lt;/code&gt; facade with the &lt;code&gt;make&lt;/code&gt; method or the &lt;code&gt;app&lt;/code&gt; or &lt;code&gt;resolve&lt;/code&gt; helper functions. When within a Service Provider you can even access the Container with &lt;code&gt;$this-&amp;gt;app&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I'll keep writing more about using the Container so if you're interested, follow me on Twitter to get alerted once the next post goes live, I'm &lt;a href="https://twitter.com/wilburpowery"&gt;@wilburpowery&lt;/a&gt; on there.&lt;/p&gt;

</description>
      <category>php</category>
      <category>laravel</category>
      <category>container</category>
      <category>ioc</category>
    </item>
    <item>
      <title>Be a good person</title>
      <dc:creator>Wilbur Powery </dc:creator>
      <pubDate>Sun, 13 May 2018 20:28:37 +0000</pubDate>
      <link>https://dev.to/wilburpowery/be-a-good-person-ef</link>
      <guid>https://dev.to/wilburpowery/be-a-good-person-ef</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AWfyx_439lPdQmtsH." class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2AWfyx_439lPdQmtsH."&gt;&lt;/a&gt;Photo by &lt;a href="https://unsplash.com/@priscilladupreez?utm_source=medium&amp;amp;utm_medium=referral" rel="noopener noreferrer"&gt;Priscilla Du Preez&lt;/a&gt; on &lt;a href="https://unsplash.com?utm_source=medium&amp;amp;utm_medium=referral" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We sometimes focus so much on becoming better at our profession or career, that we ignore becoming a better person in the process.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Ok, so yeah, I know it’s very important to keep getting better, especially in our times. Many of us might have the mentality of &lt;em&gt;“If I don’t continually learn, I’ll become obsolete”.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Let me ask you a question, Have you ever met someone who is a total master in whatever they do for a living, but they are a real pain to work with? I’m pretty sure many of us know someone who fits that description, and believe me, that is not the person you’d want to be to other people.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedium.com%2Fmedia%2F6e679674a67e6493c83a0578e4409482%2Fhref" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedium.com%2Fmedia%2F6e679674a67e6493c83a0578e4409482%2Fhref"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’m a software developer, and believe me when I say this: I’ve met some really smart and talented people who write software, they could master any programming language you throw at them, but their ability to talk to people, have empathy, and simply be a good person to others and have a positive impact in a group is really low.&lt;/p&gt;

&lt;p&gt;So, my advice to you is to simply focus on being a good person, someone people enjoy working with, because your technical knowledge will only get you so far, the rest will depend on the way you treat people and make them feel.&lt;/p&gt;

&lt;p&gt;Got any thoughts on this? Have you ever experienced working with someone like this? I’d love to hear your story.&lt;/p&gt;

</description>
      <category>person</category>
      <category>goods</category>
      <category>empathy</category>
      <category>work</category>
    </item>
    <item>
      <title>Is their any API where I could get all my posts from the site?</title>
      <dc:creator>Wilbur Powery </dc:creator>
      <pubDate>Sun, 13 May 2018 01:12:53 +0000</pubDate>
      <link>https://dev.to/wilburpowery/is-their-any-api-where-i-could-get-all-my-posts-from-the-site-2e72</link>
      <guid>https://dev.to/wilburpowery/is-their-any-api-where-i-could-get-all-my-posts-from-the-site-2e72</guid>
      <description>&lt;p&gt;Hey guys, I’m thinking on killing the blog on my site and just publishing my content here. But, I’d still like to fetch all my posts and display them in my site. Any idea if there’s an endpoint to get them?&lt;/p&gt;

</description>
      <category>help</category>
      <category>site</category>
    </item>
    <item>
      <title>Switching from Laravel to Jigsaw</title>
      <dc:creator>Wilbur Powery </dc:creator>
      <pubDate>Thu, 10 May 2018 13:42:54 +0000</pubDate>
      <link>https://dev.to/wilburpowery/switching-from-laravel-to-jigsaw-dc7</link>
      <guid>https://dev.to/wilburpowery/switching-from-laravel-to-jigsaw-dc7</guid>
      <description>&lt;p&gt;Sometime ago I gave myself the job of redesigning my personal website. The first version was made using the Laravel Framework.&lt;/p&gt;

&lt;p&gt;For this second version I started thinking if Laravel really was needed for a simple portfolio site like mine. After a few days of analyzing the code I wrote for the first version of the site, I discovered that I simply used Laravel bacause I love the Blade Templating Engine that comes with it. After coming to this realization I focused on finding a light, realiable and good tool I could use to simply set up a beautiful, eye-catching personal website where I could just create a markdown file and share my thoughts with everyone. After a few days of looking at a lot of great stuff online, I found the perfect tool for my needs, &lt;a href="http://jigsaw.tighten.co/" rel="noopener noreferrer"&gt;Jigsaw&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Jigsaw
&lt;/h3&gt;

&lt;p&gt;At it’s core, &lt;a href="http://jigsaw.tighten.co/" rel="noopener noreferrer"&gt;Jigsaw&lt;/a&gt; is a framework for building static websites. It helps developers rapidly build static sites using the same modern tooling that you would use when building dynamic web applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  What sets Jigsaw apart from common .html files
&lt;/h3&gt;

&lt;p&gt;Using &lt;a href="http://jigsaw.tighten.co/" rel="noopener noreferrer"&gt;Jigsaw&lt;/a&gt; instead of creating some .html files and serving them online brings a lot of great features to the table. You have access to a lot of great features from the Laravel Framework but in a light and minimal form.&lt;/p&gt;

&lt;h4&gt;
  
  
  Some of the features &lt;a href="http://jigsaw.tighten.co/" rel="noopener noreferrer"&gt;Jigsaw&lt;/a&gt; offers are:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Blade Templates&lt;/li&gt;
&lt;li&gt;Markdown pages&lt;/li&gt;
&lt;li&gt;.blade.md files (Yes, Blade and Markdown mix)&lt;/li&gt;
&lt;li&gt;Global Configuration File (It’s very handy)&lt;/li&gt;
&lt;li&gt;Lots of helper methods&lt;/li&gt;
&lt;li&gt;Collections&lt;/li&gt;
&lt;li&gt;Sorting&lt;/li&gt;
&lt;li&gt;Pagination&lt;/li&gt;
&lt;li&gt;Variables and helper methods&lt;/li&gt;
&lt;li&gt;Laravel Elixir support out of the box&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The last design
&lt;/h3&gt;

&lt;p&gt;Here is what the last design of the site looked like, I hope you like the new design I have made. Go take a look at the current design &lt;a href="https://wilburpowery.co" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2An_O4mfcelp613cxP.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2An_O4mfcelp613cxP.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;&lt;a href="http://jigsaw.tighten.co/" rel="noopener noreferrer"&gt;Jigsaw&lt;/a&gt; is an awesome framework for creating static websites where you just need to display static content but you still want to use some of the features you love about Laravel, like Blade templates. Getting started is very easy, their &lt;a href="http://jigsaw.tighten.co/docs/installation/" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; is great, and it’s still part of the Laravel community you love and enjoy.&lt;/p&gt;

</description>
      <category>jigsaw</category>
      <category>laravel</category>
      <category>staticsitegenerato</category>
    </item>
    <item>
      <title>Getting Started with Vue Router</title>
      <dc:creator>Wilbur Powery </dc:creator>
      <pubDate>Tue, 19 Dec 2017 00:00:00 +0000</pubDate>
      <link>https://dev.to/wilburpowery/getting-started-with-vue-router-3199</link>
      <guid>https://dev.to/wilburpowery/getting-started-with-vue-router-3199</guid>
      <description>&lt;p&gt;Vue.js is my go to Framework for building dynamic Javascript user interfaces. The thing I love the most about Vue.js is that it’s so easy to get started with it. Depending on your needs, you simply need to add a little script tag to your page, and you can embrace a great amount of the beauty of Vue. &lt;/p&gt;

&lt;p&gt;Just in case you didn’t know, Vue-Router is a Vue.js plugin to add routing to your  application. In this case, I’ll share with you a bit about how to get Vue-Router installed and setup so you can start building SPA’s in no time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install it
&lt;/h2&gt;

&lt;p&gt;You can install &lt;code&gt;vue-router&lt;/code&gt; using npm or yarn. Simply run any of the following commands in your terminal and you’re ready to keep going. &lt;br&gt;
&lt;code&gt;npm install vue-router&lt;/code&gt;&lt;br&gt;
or&lt;br&gt;
&lt;code&gt;yarn add vue-router&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Configure it
&lt;/h2&gt;

&lt;p&gt;When using a module system, you need to tell Vue.js that it must use the VueRouter plugin.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-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;Vue&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&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;VueRouter&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-router&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;VueRouter&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;router&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;./router&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Vue&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;el&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#app&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// same as router: router&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After configuring Vue to use the vue-router plugin, you need to let the parent component know that it should use that router instance.&lt;/p&gt;

&lt;p&gt;Following the previous steps, you now have &lt;code&gt;vue-router&lt;/code&gt; installed and configured and can start building out your routing configuration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Structure your application
&lt;/h2&gt;

&lt;p&gt;They are many ways you can structure your application, but I mostly choose to do mine as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I have a &lt;code&gt;router/&lt;/code&gt; folder inside the directory where I keep my scripts. &lt;/li&gt;
&lt;li&gt;Inside the &lt;code&gt;router/&lt;/code&gt; folder, I create two files, &lt;code&gt;index.js&lt;/code&gt; and &lt;code&gt;routes.js&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;index.js&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;First of all, I choose to call this file index.js because when using a module system, I can import it simply by using the following command: &lt;code&gt;import router from './router'&lt;/code&gt;. Notice I don’t need to specify the filename since modules systems will look for an &lt;code&gt;index.js&lt;/code&gt; file by default.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// router/index.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;VueRouter&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-router&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;//Import vue-router&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;routes&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;./routes&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Import my routes&lt;/span&gt;

&lt;span class="c1"&gt;//Export a new VueRouter instance&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;VueRouter&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;history&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;base&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/home/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;routes&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;They are a few things here that might not be clear to you at first glance. Let me explain each one. &lt;br&gt;
The &lt;code&gt;mode&lt;/code&gt; attribute by default is set to &lt;em&gt;hash mode&lt;/em&gt; which adds a &lt;code&gt;#&lt;/code&gt; to the url. In my case I set it to &lt;code&gt;history&lt;/code&gt; mode to prevent that and also to leverage the history.pushState API to achieve URL navigation without a page reload.&lt;br&gt;
The &lt;code&gt;base&lt;/code&gt; attribute is to set a base url section from which all the routes will extend. For example, if we set a route to &lt;code&gt;/dashboard&lt;/code&gt; , vue-router will actually look for the url &lt;code&gt;/home/dashboard&lt;/code&gt;. &lt;br&gt;
You can omit both of those attributes is you’re not looking for that behavior.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// router/routes.js&lt;/span&gt;

&lt;span class="c1"&gt;// Here we import our Vue Components&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;DashboardPage&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;../pages/Dashboard.vue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Error404&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;../pages/errors/Error404.vue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// the routes are simply an array of objects&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;routes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;redirect&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/dashboard&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/dashboard&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dashboard&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;DashboardPage&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;*&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;404&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Error404&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;routes&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Most of the Route objects needs to have at least two attributes, the &lt;code&gt;path&lt;/code&gt;  it should match and the &lt;code&gt;component&lt;/code&gt; it should display when that path is matched. &lt;br&gt;
The last object in the array with that wildcard &lt;code&gt;*&lt;/code&gt; as the path, is used to show a 404 page for any route that was not matched. You are not required to have it, it's just an example on how to handle 404 errors with the router.&lt;/p&gt;
&lt;h2&gt;
  
  
  Ok, I have it setup, how do I use it now?
&lt;/h2&gt;

&lt;p&gt;Navigating your the routes you have defined is very straight forward using two special elements Vue Router provides out of the box, they are &lt;code&gt;&amp;lt;router-link&amp;gt;&amp;lt;/router-link&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;router-view&amp;gt;&amp;lt;/router-view&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;router-link&lt;/code&gt; component renders by default an html &lt;code&gt;a&lt;/code&gt; tag. You can specify what element you want to be rendered with the &lt;code&gt;tag&lt;/code&gt; property. The &lt;code&gt;to&lt;/code&gt; property is used to specify what route should be followed once the element is clicked.&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;ul&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;router-link&lt;/span&gt; &lt;span class="na"&gt;tag=&lt;/span&gt;&lt;span class="s"&gt;"li"&lt;/span&gt; &lt;span class="na"&gt;to=&lt;/span&gt;&lt;span class="s"&gt;"/dashboard"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"list-group-item"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        Dashboard
    &lt;span class="nt"&gt;&amp;lt;/router-link&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before you can see each component rendered on your page, you need to make use of the &lt;code&gt;&amp;lt;router-view&amp;gt;&lt;/code&gt; element. Using this element is very straight forward; simply add the element anywhere in the page where you would like your components to be mounted.&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;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"row"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"col-md-12"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="c"&gt;&amp;lt;!--All components will be mounted here--&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;router-view&amp;gt;&amp;lt;/router-view&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Vue.js is a very easy to use javascript framework, and it's router plugin proves this once again. In just a few seconds,you can easily have a javascript router installed, configured and working on your application. &lt;/p&gt;

&lt;p&gt;Is there anything I missed in this post? Share it with me on &lt;a href="https://twitter.com/wilburpowery"&gt;twitter&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vue</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
