<?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 Mostafa Kamal on Medium]]></title>
        <description><![CDATA[Stories by Mostafa Kamal on Medium]]></description>
        <link>https://medium.com/@code4mk?source=rss-e10727b6cdcf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5JqOh3i_2bo4dA45oS-TSQ.jpeg</url>
            <title>Stories by Mostafa Kamal on Medium</title>
            <link>https://medium.com/@code4mk?source=rss-e10727b6cdcf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 01:49:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@code4mk/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[Install docker on aws ec2]]></title>
            <link>https://medium.com/code4mk-org/install-docker-on-aws-ec2-f8ba2b9bd072?source=rss-e10727b6cdcf------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8ba2b9bd072</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[docker-compose]]></category>
            <dc:creator><![CDATA[Mostafa Kamal]]></dc:creator>
            <pubDate>Wed, 21 Apr 2021 13:10:30 GMT</pubDate>
            <atom:updated>2021-04-21T13:10:30.824Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KKJG_3qMhdosiIEIOuvssw.png" /><figcaption>docker-aws-install</figcaption></figure><p><strong>Docker</strong> is an open platform for developing, shipping, and running applications.</p><p># aws cli (cli command)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/573f442ea87b7699df9e706d7d5915a4/href">https://medium.com/media/573f442ea87b7699df9e706d7d5915a4/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8ba2b9bd072" width="1" height="1" alt=""><hr><p><a href="https://medium.com/code4mk-org/install-docker-on-aws-ec2-f8ba2b9bd072">Install docker on aws ec2</a> was originally published in <a href="https://medium.com/code4mk-org">code4mk organization</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why choose Next.js?]]></title>
            <link>https://medium.com/code4mk-org/why-choose-next-js-af015d28c875?source=rss-e10727b6cdcf------2</link>
            <guid isPermaLink="false">https://medium.com/p/af015d28c875</guid>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[code4mk]]></category>
            <category><![CDATA[playnextjs]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Mostafa Kamal]]></dc:creator>
            <pubDate>Wed, 09 Dec 2020 10:30:07 GMT</pubDate>
            <atom:updated>2020-12-09T10:30:07.684Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lzM2JyudCgUYCqV1GEfgNw.png" /></figure><p><strong><em>Why choose Next.js?</em></strong></p><p><em>#play_next_js</em></p><p><em>React.js is the most favorite Library. Next.js is a React framework, created by </em><strong><em>Zeit</em></strong></p><p><strong><em>Next.js pick for SEO purpose (Server Side Rendering )</em></strong></p><p><strong><em># Key points</em></strong></p><ul><li><em>Server side rendering (SSR)</em></li><li><em>SPA (Single page application)</em></li><li><em>Auto routing</em></li><li><em>SEO friendly</em></li><li><em>Image optimization</em></li><li><em>Best performance</em></li><li><em>Friendly Community</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*pLv5hPf2VstS_edeQ3QTxw.png" /></figure><p><strong><em># resource</em></strong></p><ul><li><a href="https://nextjs.org/"><em>nextjs</em></a></li><li><a href="https://github.com/unicodeveloper/awesome-nextjs"><em>awesome-nextjs</em></a></li><li><a href="https://nextjsnotes.com/"><em>nextjsnotes</em></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af015d28c875" width="1" height="1" alt=""><hr><p><a href="https://medium.com/code4mk-org/why-choose-next-js-af015d28c875">Why choose Next.js?</a> was originally published in <a href="https://medium.com/code4mk-org">code4mk organization</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Laravel on-demand notification delay]]></title>
            <link>https://medium.com/hello-laravel/laravel-on-demand-notification-delay-e8a7fd0dd321?source=rss-e10727b6cdcf------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8a7fd0dd321</guid>
            <category><![CDATA[notifications]]></category>
            <category><![CDATA[laravel]]></category>
            <dc:creator><![CDATA[Mostafa Kamal]]></dc:creator>
            <pubDate>Sun, 26 Jan 2020 08:22:22 GMT</pubDate>
            <atom:updated>2020-01-26T08:23:52.785Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XyJ4Uy6cSoE4TORDn_1YxA.png" /></figure><p>Notification is a short and informational message that notifies a user.</p><pre>php artisan make:notification OrderComplete</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/395a695292a89dc0a83ce820599512bc/href">https://medium.com/media/395a695292a89dc0a83ce820599512bc/href</a></iframe><p>implements ShouldQueue and trait Queueable</p><p>Now call the notification inside your controller or others file.</p><pre>use App\Notifications\OrderComplete;</pre><pre>Notification::route(&#39;mail&#39;, &#39;<a href="/service/mailto:hiremostafa@gmail.com">hiremostafa@gmail.com</a>&#39;)<br>            -&gt;notify(<br>            (new OrderComplete())-&gt;delay(now()&gt;addMinutes(1))<br>          );</pre><p>~ Setup queue environment (Queue)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8a7fd0dd321" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hello-laravel/laravel-on-demand-notification-delay-e8a7fd0dd321">Laravel on-demand notification delay</a> was originally published in <a href="https://medium.com/hello-laravel">Hello Laravel</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Laravel queue system with job]]></title>
            <link>https://medium.com/hello-laravel/laravel-queue-system-with-job-ec6e26052237?source=rss-e10727b6cdcf------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec6e26052237</guid>
            <category><![CDATA[laravel]]></category>
            <dc:creator><![CDATA[Mostafa Kamal]]></dc:creator>
            <pubDate>Sat, 25 Jan 2020 10:54:42 GMT</pubDate>
            <atom:updated>2020-01-25T11:00:33.951Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*648qLpjJcAUXsBLognFL0w.png" /></figure><p>#code4mk #laravel</p><p><strong><em># Queue:</em></strong><em> Queue is a FIFO (first in first out). Queue task waiting to complete the previous task.</em></p><p><strong><em>Laravel Queue:</em></strong><em> Laravel queue system increase performance of request and reduce the loading time.</em></p><p><em>Basically queue is a time-consuming task but run background on the server.</em></p><p><strong><em># Job</em></strong></p><p><em>Job is a specific task for a specific queue.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*ZVwebrmuRslN0D-qODmI-w.png" /></figure><p><strong><em># set queue connection on .env file</em></strong></p><pre><em>QUEUE_CONNECTION=database</em></pre><p><em>php artisan config:cache or php artisan config:clear</em></p><p><strong><em># queue table generate</em></strong></p><pre><em>php artisan queue:table<br># if don&#39;t have job fails table <br>php artisan queue:failed-table<br>php artisan migrate</em></pre><p><strong><em># create a job</em></strong></p><p><em>php artisan make:job MailSend</em></p><p><em>This command creates a MailSend job inside App/Jobs</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MuYR52y3am1Q-jA1iT-bbA.png" /></figure><p><strong><em>~ handle</em></strong></p><p><em>basically handle method calls when the queue is processed. and payload store handle methods and others properties.</em></p><p><strong><em># call job inside controller or others</em></strong></p><p><em>dispatch()</em></p><pre><em>use App\Jobs\MailSend;</em></pre><pre><em>dispatch(new MailSend($data))-&gt;delay(now()-&gt;addMinutes(1));</em></pre><p><em># run queue command on your server</em></p><pre><em>php artisan queue:work <br># or <br>php artisan queue:listen</em></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec6e26052237" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hello-laravel/laravel-queue-system-with-job-ec6e26052237">Laravel queue system with job</a> was originally published in <a href="https://medium.com/hello-laravel">Hello Laravel</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Laravel Application Unit Testing.]]></title>
            <link>https://medium.com/hello-laravel/laravel-unit-test-13d82c49f72a?source=rss-e10727b6cdcf------2</link>
            <guid isPermaLink="false">https://medium.com/p/13d82c49f72a</guid>
            <category><![CDATA[laravel]]></category>
            <dc:creator><![CDATA[Mostafa Kamal]]></dc:creator>
            <pubDate>Mon, 14 Oct 2019 06:32:58 GMT</pubDate>
            <atom:updated>2019-10-14T07:12:25.123Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZDSDrR-__AuCIw00-yrm0g.png" /></figure><p><em>laravel testing, #code4mk , #testing</em></p><p><em>Laravel built with testing in mind. Laravel support PHPUnit testing.</em></p><p><strong><em># 1. Configure xml file</em></strong></p><p>NB: bash cli</p><pre><em># command with  bash cli<br>./vendor/bin/phpunit --configuration /path/to/laravel_project/phpunit.xml</em></pre><p><strong><em># 2. Make a Test</em></strong></p><pre><em>php artisan make:test AppTest --unit</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-heVUjfbOCRGt4hXhLuKKg.png" /></figure><p><strong><em># 3. Run Test</em></strong></p><pre><em># all file<br>./vendor/bin/phpunit<br># specific file<br>./vendor/bin/phpunit tests/Unit/AppTest.php</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z6vTV-8edbaVL7_bZZKleA.png" /></figure><p><strong># Database test</strong></p><p>~ .<em>env database</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FSTp5zXdWdI0YpGeKmj0Bg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=13d82c49f72a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hello-laravel/laravel-unit-test-13d82c49f72a">Laravel Application Unit Testing.</a> was originally published in <a href="https://medium.com/hello-laravel">Hello Laravel</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Laravel Event Listeners ( queue )]]></title>
            <link>https://medium.com/hello-laravel/laravel-event-listeners-queue-161bc9b846ed?source=rss-e10727b6cdcf------2</link>
            <guid isPermaLink="false">https://medium.com/p/161bc9b846ed</guid>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Mostafa Kamal]]></dc:creator>
            <pubDate>Thu, 12 Sep 2019 16:19:53 GMT</pubDate>
            <atom:updated>2019-09-12T16:41:40.154Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CSVbZ1aS9SPV7eIyQZtE2A.png" /><figcaption>courtesy : image from andersontech</figcaption></figure><ul><li><em>Event is a specific </em><em>task.</em></li><li><em>Listener </em><em>listen a </em><em>event then </em><em>trigger one or many </em><em>actions.</em></li><li><em>Actions&lt;- Listener &lt;- listen (event)</em></li></ul><pre><em># generate from kernel<br>php artisan event:generate<br># manually create<br>php artisan make:listener ListenerName<br>php artisan make:event EventName</em></pre><h3><em>event</em></h3><ul><li><em>EventName class.</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PvWlFs3tfIRTWkvss8pRyA.png" /></figure><h3><em>listener</em></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S52-t7AFOjPzsgGd9j329A.png" /></figure><h3><em>register</em></h3><ul><li><em>app\Providers\EventServiceProvider.php</em></li></ul><pre><em>protected $listen = [<br>    &#39;App\Events\EventName&#39; =&gt; [<br>        &#39;App\Listeners\ListenerName1&#39;,<br>        &#39;App\Listeners\ListenerName2&#39;,<br>        &#39;App\Listeners\ListenerNameALotOF&#39;,<br>    ],<br>];</em></pre><h3><em>fire / dispatching</em></h3><pre><em>use App\Events\OrderShipped;<br>event(new EventName($order));</em></pre><p><strong><em># queue</em></strong></p><h3>event with queue</h3><ul><li>table create</li></ul><pre>php artisan queue:table<br>php artisan migrate</pre><ul><li>php artisan queue:table php artisan migrate</li><li>update inside .env for (database)</li><li>QUEUE_CONNECTION=database</li><li>implements ShouldQueue in ListenName class</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rGNha-wDxqW6d8HRamrLdA.png" /></figure><ul><li>php artisan queue::work</li></ul><h3>event with queue 2nd method</h3><ul><li>table create</li></ul><pre>php artisan queue:table<br>php artisan migrate </pre><p>implements ShouldQueue in ListenName class</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TGvVEdkOI3ffP0d9Hb10Pw.png" /></figure><ul><li>php artisan queue::work database — queue=listeners</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=161bc9b846ed" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hello-laravel/laravel-event-listeners-queue-161bc9b846ed">Laravel Event Listeners ( queue )</a> was originally published in <a href="https://medium.com/hello-laravel">Hello Laravel</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Don’t care about pages feature in nuxt.js ( custom router )]]></title>
            <link>https://medium.com/code4mk-org/dont-care-about-pages-feature-in-nuxt-js-custom-router-a94ef880d3c8?source=rss-e10727b6cdcf------2</link>
            <guid isPermaLink="false">https://medium.com/p/a94ef880d3c8</guid>
            <category><![CDATA[nuxtjs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[vue]]></category>
            <category><![CDATA[vuejs]]></category>
            <dc:creator><![CDATA[Mostafa Kamal]]></dc:creator>
            <pubDate>Mon, 24 Jun 2019 11:40:41 GMT</pubDate>
            <atom:updated>2019-06-25T11:10:25.741Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aDVG86Xrg6NVwOskQ6XuAw.png" /></figure><p><em>#custom_route_nuxt #nuxtjs #nuxt #code4mk</em></p><p><strong><em># pages</em></strong></p><p><em>pages automaticaly generate router that this amazing. but a big project pages system is so boring. because can’t standard folder system for project specific feature.</em></p><p><em>if you are familiar with vue router and vue dev this content for you. </em><strong><em>if you don’t like this content , you can skip this post.</em></strong></p><p><strong><em># why not use pages directory</em></strong></p><p><strong><em>~ if want to this is type router</em></strong></p><p><em>127.0.0.1:3000/admin/balance</em></p><p><em>127.0.0.1:3000/admin/withdraw</em></p><p><strong><em>~ and want this is type directory</em></strong></p><pre><em>pages/<br>  finance/<br>   balance.vue<br>   withdraw.vue</em></pre><p><em>It is not possible, beacuse nuxt generate route automatically.</em></p><p><em>127.0.0.1:3000/finance/balance and </em><em>127.0.0.1:3000/finance/withdraw</em></p><p><strong><em># solve</em></strong></p><p><strong><em>create a folder</em></strong><em> as your desired name ( </em><em>ex:project )in </em><strong><em>root directory.</em></strong></p><pre><em>project/<br>  finance/<br>   balance.vue<br>   withdraw.vue</em></pre><blockquote><em>~ you can use core feature inside your vue file. as( </em><em>layout , </em><em>middleware , </em><em>component, </em><em>assets and so on</em></blockquote><p><strong><em>~ create routes folder inside root directory.</em></strong></p><p>custom route vue nuxt</p><ul><li><em>routes\index.js</em></li></ul><pre><em>module.exports = [<br>  {<br>    name: &#39;balance&#39;,<br>    path: &#39;/admin/balance&#39;,<br>    component: &#39;project/finance/balance.vue&#39;<br>  },<br>  {<br>    name: &#39;withdraw&#39;,<br>    path: &#39;/admin/withdraw&#39;,<br>    component: &#39;project/finance/withdraw.vue&#39;<br>  }<br>]</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sCvY-fLq2L9jATU_lAvUWw.png" /></figure><p><em>~ nuxt.config.js</em></p><pre>// nuxt.config.js                     <br>const routes = require(&#39;./routes/index.js&#39;)</pre><pre>router: {<br>  <br>  extendRoutes (nuxtRoutes, resolve) {<br>    routes.forEach((route)=&gt;{<br>      nuxtRoutes.push({<br>        name: route.name,<br>        path: route.path,<br>        component: resolve(__dirname, route.component)<br>      })<br>    })<br>  }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q-n9UbmrRq7vUq8B7Sq6EQ.png" /></figure><p><em>done now your router is ready</em></p><p><em>127.0.0.1:3000/admin/balance ,</em><em>127.0.0.1:3000/admin/withdraw and all vue file live inside </em><em>project/finance folder instead of </em><em>pages .</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a94ef880d3c8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/code4mk-org/dont-care-about-pages-feature-in-nuxt-js-custom-router-a94ef880d3c8">Don’t care about pages feature in nuxt.js ( custom router )</a> was originally published in <a href="https://medium.com/code4mk-org">code4mk organization</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setup maintenance mode in Nuxt.js]]></title>
            <link>https://medium.com/code4mk-org/nuxt-maintenance-mode-48e158c429e2?source=rss-e10727b6cdcf------2</link>
            <guid isPermaLink="false">https://medium.com/p/48e158c429e2</guid>
            <category><![CDATA[nuxtjs]]></category>
            <category><![CDATA[vuejs]]></category>
            <dc:creator><![CDATA[Mostafa Kamal]]></dc:creator>
            <pubDate>Sat, 22 Jun 2019 13:12:46 GMT</pubDate>
            <atom:updated>2019-06-22T13:12:46.858Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fj0ZTFqTk7OuMHgsmHVqWA.png" /><figcaption>code4mk</figcaption></figure><p><em>#nuxtjs #nuxt #code4mk #vue</em></p><p><strong><em>#</em></strong>maintenance <strong><em>Mode</em></strong></p><p><em>Sometimes you need to your site on maintenance mode. you can easily setup </em>maintenance <em>mode in nuxt app.</em></p><p><strong><em># Maintenance page</em></strong></p><p><em>create a maintenance page as </em><em>page\maintenance.vue</em></p><pre><em>&lt;template lang=&quot;html&quot;&gt;</em></pre><pre><em>&lt;div class=&quot;content&quot;&gt;<br>  &lt;div class=&quot;maintenance&quot;&gt;<br>    &lt;h1&gt; Maintenance Mode &lt;/h1&gt;<br>    &lt;h1&gt;Nuxt.js </em><a href="http://twitter.com/code4mk"><em>@code4mk</em></a><em>&lt;/h1&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;<br>&lt;/template&gt;</em></pre><pre><em>&lt;script&gt;<br>export default {<br>mounted: function () {<br>  console.log(this.$route.path)<br>}<br>}<br>&lt;/script&gt;</em></pre><pre><em>&lt;style lang=&quot;css&quot; scoped &gt;<br>body, html {<br>  height: 100%;<br>  width: 100%;<br>  font-family: &#39;Open Sans Condensed&#39;, sans-serif;<br>  font-size: 1em;<br>}<br>.maintenance h1 {<br>  font-size: 190%;<br>  color: #fff;<br>  text-shadow: -2px 2px 3px rgba(0,0,0,0.5);<br>  color: #d6336c;<br>  text-align: center;<br>}<br>.maintenance {<br>  /* width: 200px; */<br>  height: 200px;<br>  position: absolute;<br>  left: 50%;<br>  top: 50%;<br>  margin-left: -100px;<br>  fill: #d6336c;</em></pre><pre><em>}<br>.content {<br>  height: 100%;<br>  width: 100%;<br>  background-color: #5471B9;<br>}<br>&lt;/style&gt;</em></pre><p><strong><em># middleware</em></strong></p><p><em>create a middleware as</em><em>middleware\maintenance.js</em></p><pre><em>export default function ({redirect,route}) {<br> let isMaintenance = true;<br> if(isMaintenance){<br>   return redirect(&#39;/maintenance&#39;)<br> }<br> if(isMaintenance=== false &amp;&amp; route.path === &#39;/maintenance&#39;){<br>   return redirect(&#39;/&#39;)<br> }<br>}</em></pre><ul><li><em>isMaintenance type is boolean . you can declare it true or false.</em></li></ul><p><strong><em># nuxt.config.js</em></strong></p><p><em>now include the middleware as router middleware</em></p><pre><em>router: {<br>    middleware: &#39;</em><em>maintenance&#39;<br>  },</em></pre><p><strong><em>Now your nuxt app is maintenance mode</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48e158c429e2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/code4mk-org/nuxt-maintenance-mode-48e158c429e2">Setup maintenance mode in Nuxt.js</a> was originally published in <a href="https://medium.com/code4mk-org">code4mk organization</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setup nuxt internationalization with vue-i18n]]></title>
            <link>https://medium.com/code4mk-org/nuxt-i18n-2d2c1275132e?source=rss-e10727b6cdcf------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d2c1275132e</guid>
            <category><![CDATA[nuxtjs]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[i18n]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Mostafa Kamal]]></dc:creator>
            <pubDate>Mon, 17 Jun 2019 17:29:52 GMT</pubDate>
            <atom:updated>2019-07-03T10:45:10.187Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qjKp6Pog92c3SFzxOx7v6A.png" /></figure><h3>Easily setup nuxt internationalization with vue-i18n</h3><p><em>#nuxt #nuxtjs #i18n #code4mk.</em></p><p><strong># vue-i18n</strong></p><p><em>vue-i18n is best intertionalization plugin for vue project.</em></p><p><strong><em># how add vue-i18n inside nuxt</em></strong></p><p><em>Nuxt.js link up package by plugin system. create a plugin then add that inside nuxt.config.js</em></p><p><strong><em># create plugin</em></strong></p><p>~ plugins/i18n.js</p><pre><em>import Vue from &#39;vue&#39;<br>import VueI18n from &#39;vue-i18n&#39;</em></pre><pre><em>Vue.use(VueI18n)</em></pre><pre><em>export default ({ app, store}) =&gt; {<br> app.i18n = new VueI18n({<br>    locale: &#39;en&#39;,<br>    fallbackLocale: &#39;en&#39;,<br>    silentTranslationWarn: true,<br>    messages: {<br>      &#39;bn&#39;: {<br>        &#39;menu&#39;:{<br>          &#39;home&#39;: &#39;হোম&#39;,<br>          &#39;blog&#39;: &#39;ব্লগ&#39;,<br>          &#39;contact&#39;: &#39;যোগাযোগ&#39;<br>        },<br>      },<br>      &#39;en&#39;: {<br>        &quot;menu&quot;: {<br>          &#39;home&#39;: &#39;home&#39;,<br>          &#39;blog&#39;: &#39;blog&#39;,<br>          &#39;contact&#39;: &#39;contact&#39;<br>        },<br>      },<br>     },<br> }<br>})</em></pre><pre><em>//app.i18n.locale = &#39;bn&#39;</em></pre><pre><em> app.i18n.path = (link) =&gt; {<br>    if (app.i18n.locale === app.i18n.fallbackLocale) {<br>      return `/${link}`<br>    }<br>   return `/${app.i18n.locale}/${link}`<br>  }<br>}</em></pre><p><strong><em># plugin add in nuxt config</em></strong></p><pre><em>plugins: [<br>    &#39;~/plugins/i18n.js&#39;<br>  ]</em></pre><p><strong># nuxt page</strong></p><pre><em>&lt;template&gt;</em></pre><pre><em>&lt;div class&gt;</em></pre><pre><em>&lt;ul&gt;</em></pre><pre><em>&lt;li class=&quot;my-list&quot;&gt;{{$t(&quot;menu.home&quot;)}}&lt;/li&gt;</em></pre><pre><em>&lt;li class=&quot;my-list&quot;&gt;{{$t(&quot;menu.blog&quot;)}}&lt;/li&gt;</em></pre><pre><em>&lt;li class=&quot;my-list&quot;&gt;{{$t(&quot;menu.contact&quot;)}}&lt;/li&gt;</em></pre><pre><em>&lt;li&gt;</em></pre><pre><em>&lt;select v-model=&quot;$i18n.locale&quot; @change=&quot;lang($i18n.locale)&quot;&gt;</em></pre><pre><em>&lt;option v-for=&quot;(lang, i) in </em>$i18n.availableLocales<em>&quot; :key=&quot;`Lang${i}`&quot; :value=&quot;lang&quot;&gt;{{ lang }}&lt;/option&gt;</em></pre><pre><em>&lt;/select&gt;</em></pre><pre><em>&lt;/li&gt;</em></pre><pre><em>&lt;/ul&gt;</em></pre><pre><em>&lt;/div&gt;</em></pre><pre><em>&lt;/template&gt;</em></pre><pre><em>&lt;script&gt;</em></pre><pre><em>export default {</em></pre><pre><em>created: function() {</em></pre><pre><em>if (process.browser) {</em></pre><pre><em>if (localStorage.getItem(&quot;lang&quot;)) {</em></pre><pre><em>if (this.$route.query.lang) {</em></pre><pre><em>this.$i18n.locale = this.$route.query.lang;</em></pre><pre><em>} else {</em></pre><pre><em>this.$i18n.locale = localStorage.getItem(&quot;lang&quot;);</em></pre><pre><em>}</em></pre><pre><em>}</em></pre><pre><em>}</em></pre><pre><em>},</em></pre><pre><em>methods: {</em></pre><pre><em>lang: function(l) {</em></pre><pre><em>this.$router.push({</em></pre><pre><em>query: {</em></pre><pre><em>lang: l</em></pre><pre><em>}</em></pre><pre><em>});</em></pre><pre><em>this.$i18n.locale = l;</em></pre><pre><em>if (process.browser) {</em></pre><pre><em>localStorage.setItem(&quot;lang&quot;, l);</em></pre><pre><em>}</em></pre><pre><em>}</em></pre><pre><em>}</em></pre><pre><em>};</em></pre><pre><em>&lt;/script&gt;</em></pre><pre><em>&lt;style lang=&quot;css&quot; scoped &gt;</em></pre><pre><em>ul {</em></pre><pre><em>list-style: none;</em></pre><pre><em>display: block;</em></pre><pre><em>}</em></pre><pre><em>ul li {</em></pre><pre><em>display: inline-block;</em></pre><pre><em>}</em></pre><pre><em>.my-list {</em></pre><pre><em>color: blue;</em></pre><pre><em>cursor: pointer;</em></pre><pre><em>}</em></pre><pre><em>&lt;/style&gt;</em></pre><p><strong># demo</strong></p><p><a href="https://codesandbox.io/s/codesandbox-nuxt-0nhvm">codesandbox-nuxt - CodeSandbox</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d2c1275132e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/code4mk-org/nuxt-i18n-2d2c1275132e">Setup nuxt internationalization with vue-i18n</a> was originally published in <a href="https://medium.com/code4mk-org">code4mk organization</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to setup editor.js in vuejs without hassle]]></title>
            <link>https://medium.com/code4mk-org/editorjs-vue-a78110c3fff8?source=rss-e10727b6cdcf------2</link>
            <guid isPermaLink="false">https://medium.com/p/a78110c3fff8</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[editorjs]]></category>
            <category><![CDATA[code4mk]]></category>
            <dc:creator><![CDATA[Mostafa Kamal]]></dc:creator>
            <pubDate>Thu, 23 May 2019 22:46:19 GMT</pubDate>
            <atom:updated>2019-05-23T22:52:11.352Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8nMwY4IaZkM4uZ6DlM6YJA.png" /><figcaption>editorjs</figcaption></figure><p><em>#editorjs #vue_editorjs #editorjs_vue #code4mk</em></p><p><a href="https://editorjs.io/"><strong><em>editor.js</em></strong></a></p><p><a href="https://editorjs.io/"><em>Editor.js</em></a><em> is a next-generation block-based editor, and it’s open source. editor.js returns a JSON output. editor.js built by </em><a href="https://codex.so/"><em>codex-team</em></a><em>.</em></p><p><em>core block plugins are </em><em>header </em><em>paragraph </em><em>image </em><em>embed </em><em>list </em><em>table and so on. </em><a href="https://github.com/editor-js/"><em>plugin organization</em></a></p><p><em># </em><strong><em>Implement editorjs with vuejs pos</em></strong></p><pre>npm install @editorjs/editorjs<br>npm install @editorjs/header<br>npm install @editorjs/paragraph<br>npm install @editorjs/list</pre><ul><li>you can install your desired block from editorjs.</li></ul><p><strong># vue file</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3d91b48c2f1c01398e398c3e1e46691/href">https://medium.com/media/a3d91b48c2f1c01398e398c3e1e46691/href</a></iframe><p><strong><em># codesandbox</em></strong></p><ul><li><a href="https://codesandbox.io/s/editorjsvue-eosbi"><em>codesandbox vue project</em></a></li><li><a href="https://eosbi.codesandbox.io/"><em>demo codesandbox</em></a></li></ul><p><strong><em># official</em></strong></p><ul><li><a href="https://editorjs.io/">editor.js</a></li><li><a href="https://github.com/codex-team/editor.js">github editorjs</a></li><li><a href="https://github.com/editor-js/">github editorjs plugins</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a78110c3fff8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/code4mk-org/editorjs-vue-a78110c3fff8">How to setup editor.js in vuejs without hassle</a> was originally published in <a href="https://medium.com/code4mk-org">code4mk organization</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>