<?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: Mina Farag</title>
    <description>The latest articles on DEV Community by Mina Farag (@__mfarag).</description>
    <link>https://dev.to/__mfarag</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%2F130016%2Fefc4d803-88f2-40a0-8390-d9f0d0ec94ec.jpg</url>
      <title>DEV Community: Mina Farag</title>
      <link>https://dev.to/__mfarag</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/__mfarag"/>
    <language>en</language>
    <item>
      <title>Vue events causing your page to reload, Here is a quick fix</title>
      <dc:creator>Mina Farag</dc:creator>
      <pubDate>Fri, 13 Nov 2020 13:38:34 +0000</pubDate>
      <link>https://dev.to/__mfarag/vue-events-causing-your-page-to-reload-here-is-a-quick-fix-52hf</link>
      <guid>https://dev.to/__mfarag/vue-events-causing-your-page-to-reload-here-is-a-quick-fix-52hf</guid>
      <description>&lt;p&gt;Hello hello, I know it's a very annoying issue to find your page reloads after submitting a form or clicking a link that triggers a Vue event handler.&lt;/p&gt;

&lt;p&gt;To be on the same page I added this dummy code to increment a number by clicking an anchor tag.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div id="app"&amp;gt;
    &amp;lt;a href="#" @click="handleIncrement"&amp;gt;Click to increment&amp;lt;/a&amp;gt;&amp;lt;template&amp;gt; You clicked me: {{count}}&amp;lt;/template&amp;gt;
&amp;lt;/div&amp;gt;

&amp;lt;script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script&amp;gt;
    let app = new Vue({
        el:'#app',
        data:{
         count:1
        },
        methods:{
           handleIncrement(){
              this.count++
           }
        }
    })
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice the anchor tag reference is equals to a '#' hashtag, If you removed this hashtag you will break the flow and nothing will happen when you click the same link.&lt;/p&gt;

&lt;p&gt;But leaving this hashtag causes the issue I'm talking about, you'll find the page reloads after every and each single click. This issue is known as the default behavior.&lt;/p&gt;

&lt;p&gt;Because Vue is a very smart JS framework the solution is very handy. You'll add "&lt;strong&gt;.prevent&lt;/strong&gt;" to the event handler so it will be like "&lt;strong&gt;@click.prevent&lt;/strong&gt;" this will prevent the default behavior after clicking the link.&lt;/p&gt;

&lt;p&gt;Check the following code updates&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ADD: &lt;strong&gt;".prevent"&lt;/strong&gt; to the event handler &lt;em&gt;(@click -&amp;gt;@click.prevent)&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;UPD: the anchor-tag and nullified the reference &lt;em&gt;(href="#" -&amp;gt; href='')&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;a href="" @click.prevent="handleIncrement"&amp;gt;Click to increment&amp;lt;/a&amp;gt;&amp;lt;template&amp;gt; You clicked me: {{count}}&amp;lt;/template&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now your page will work like a champion and never reloads again.&lt;/p&gt;

</description>
      <category>vue</category>
      <category>html</category>
    </item>
    <item>
      <title>What was my dream , yesterday ? as a - DEV -</title>
      <dc:creator>Mina Farag</dc:creator>
      <pubDate>Wed, 29 May 2019 10:04:08 +0000</pubDate>
      <link>https://dev.to/__mfarag/what-was-my-dream-yesterday-as-a-dev-15k4</link>
      <guid>https://dev.to/__mfarag/what-was-my-dream-yesterday-as-a-dev-15k4</guid>
      <description>&lt;p&gt;&lt;strong&gt;Since&lt;/strong&gt; i've joined a remote team of passionate developers, To work on a very exciting advanced Laravel system. My brain started to build a new type of dreams that am not used to. like the one i saw yesterday.&lt;/p&gt;

&lt;h4&gt;
  
  
  Yesterday's Dream:
&lt;/h4&gt;

&lt;p&gt;i slept in a latehour as usual because am a night owl developer. After being a sleep for a while i remember seen a &lt;strong&gt;blank bright white screen&lt;/strong&gt; and suddenly i felt my well and myself started to type a static class called &lt;strong&gt;Dream&lt;/strong&gt; like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php 
class Dream {

  public static function getRandom($rnd){
        return Dreams::all()-&amp;gt;find($rnd);
  }

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

&lt;/div&gt;



&lt;p&gt;Then i returned back to a new &lt;strong&gt;blank white screen&lt;/strong&gt; , and with a beautiful thin black font i coded&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
use Dream;
$currentDream = Dream::getRandom(4);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Dream Execution
&lt;/h4&gt;

&lt;p&gt;and it was fascinating , like a whole new movie has just started and i was into it literally. after a while i felt like i needed to change the dream so i &lt;em&gt;CMD+Tab&lt;/em&gt;  and get back to the blank white again. i called the static function changing the random number argument. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Suddenly&lt;/strong&gt; i start seeing a new dream of my ex , my old town and a lot of old friends.&lt;/p&gt;

&lt;h4&gt;
  
  
  I woke up
&lt;/h4&gt;

&lt;p&gt;I was very amazed with &lt;em&gt;how our brains as a developers function?&lt;/em&gt;, And i literally loved my yesterday scenario and the way my brain amazingly did it. So i decided when i wake up i will share it here.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;thanks for your time&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>offtopic</category>
      <category>laravel</category>
      <category>php</category>
      <category>truestory</category>
    </item>
    <item>
      <title>AI Short Note</title>
      <dc:creator>Mina Farag</dc:creator>
      <pubDate>Tue, 14 May 2019 12:04:06 +0000</pubDate>
      <link>https://dev.to/__mfarag/ai-short-note-3c5d</link>
      <guid>https://dev.to/__mfarag/ai-short-note-3c5d</guid>
      <description>&lt;h2&gt;
  
  
  Short Note on AI:
&lt;/h2&gt;

&lt;p&gt;By default when two biological smart entities start chatting each other. &lt;/p&gt;

&lt;p&gt;They follow a polymorphic custom pattern &lt;strong&gt;(PCP)&lt;/strong&gt; , Each &lt;strong&gt;PCP&lt;/strong&gt; is a reflection of a developed characteristics within each entity.&lt;/p&gt;

&lt;p&gt;After a time-distance period with a continuous both-ways chatting process, We would notice private custom made language usage. Like one-to-one private dictionary. &lt;/p&gt;

&lt;p&gt;The Smart of both entities is collaborating to form and coming up with a custom private higher level conversations. Not yet publicly available outside the one-to-one relation but capable of carrying out new comprehensive references cleared for both of them.&lt;/p&gt;

&lt;p&gt;This short notice is typically happened when we - as humans - tried to let two Artificial intelligence entities chatting each other. in seconds they formed and built their own custom private higher level conversations. &lt;/p&gt;

&lt;p&gt;By &lt;br&gt;
Mina Farag&lt;/p&gt;

&lt;p&gt;References:&lt;br&gt;
&lt;a href="https://www.independent.co.uk/life-style/gadgets-and-tech/news/facebook-artificial-intelligence-ai-chatbot-new-language-research-openai-google-a7869706.html"&gt;Facebook Chatbots 2017&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>laravel</category>
      <category>note</category>
    </item>
    <item>
      <title>Build your First Laravel Helpers</title>
      <dc:creator>Mina Farag</dc:creator>
      <pubDate>Thu, 31 Jan 2019 21:28:02 +0000</pubDate>
      <link>https://dev.to/__mfarag/build-your-first-laravel-helpers-519b</link>
      <guid>https://dev.to/__mfarag/build-your-first-laravel-helpers-519b</guid>
      <description>&lt;h3&gt;
  
  
  What are Helpers?
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;helpers are&lt;/em&gt; all the little tiny magical methods you'll create today. It's a more advanced way of increasing your code efficiency and clearance.&lt;br&gt;
&lt;em&gt;In a WebDev way of declaring stuff&lt;/em&gt;: It's group of custom-built methods but not classes.&lt;/p&gt;



&lt;h3&gt;
  
  
  Let's Set it up.
&lt;/h3&gt;

&lt;p&gt;[1] &lt;br&gt;
using any IDE - &lt;em&gt;i use &lt;a href="https://www.sublimetext.com" rel="noopener noreferrer"&gt;sublime&lt;/a&gt; myself&lt;/em&gt;. Please create a new (&lt;em&gt;.php&lt;/em&gt;) file &amp;amp; name it (&lt;em&gt;helpers.php&lt;/em&gt;), Then save it to your app directory.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;your-side (dir) will be like&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;app/helpers.php&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;note&lt;/em&gt; &lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;we don't use the (&lt;strong&gt;.blade.php&lt;/strong&gt;) layer for this file. &lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;



&lt;br&gt;
&lt;br&gt;&lt;br&gt;
[2]&lt;br&gt;
let's assume you wanna inject your &lt;strong&gt;layout.blade.php&lt;/strong&gt; template file with &lt;a href="https://fontawesome.com/icons?d=gallery&amp;amp;m=free" rel="noopener noreferrer"&gt;FontAwesome&lt;/a&gt; Icons-Api. So the usual way is to just add a &lt;strong&gt;link tag&lt;/strong&gt; referencing your Api like the following:

&lt;p&gt;&lt;em&gt;code&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;head&amp;gt; &lt;br&gt;
&amp;lt;link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css"crossorigin="anonymous"&amp;gt;&lt;br&gt;
 &amp;lt;/head&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;note&lt;/em&gt; &lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;i've deleted part of the link ,but you can have a new full-api-link &lt;a href="https://fontawesome.com/start" rel="noopener noreferrer"&gt;here&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;[2-2]&lt;br&gt;
&lt;em&gt;Side-Question&lt;/em&gt;/ Please think with me, What if you wanna use more apis?&lt;br&gt;
&lt;em&gt;Answer&lt;/em&gt;/ &lt;strong&gt;aooch&lt;/strong&gt; A &lt;em&gt;head tag&lt;/em&gt; filled with blocks of multiple unclean lines. &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%2Fi.pinimg.com%2F564x%2Fc9%2F84%2Fb9%2Fc984b9ab6affc907e8771ba76a728402.jpg" 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%2Fi.pinimg.com%2F564x%2Fc9%2F84%2Fb9%2Fc984b9ab6affc907e8771ba76a728402.jpg" alt="the Beautiful Laravel"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;br&gt;
&lt;br&gt;&lt;br&gt;
[3]&lt;br&gt;
give yourself &lt;strong&gt;[5-minutes]&lt;/strong&gt; : &lt;em&gt;eyes-looking-to-the-ceiling&lt;/em&gt;. Work your mind to create a feature that can clean up our code? &lt;em&gt;you can use a paper and a pencil&lt;/em&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%2Fi.pinimg.com%2Foriginals%2F51%2Fa3%2F37%2F51a337efac7c505665820aee3bfddd8e.gif" 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%2Fi.pinimg.com%2Foriginals%2F51%2Fa3%2F37%2F51a337efac7c505665820aee3bfddd8e.gif" alt="hmmm"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[3-2]&lt;br&gt;
now We're talking about a &lt;strong&gt;helper feature or functionality&lt;/strong&gt; &amp;amp; Yeaaa  for sure this is one tiny purpose of using &lt;strong&gt;Laravel Custom Built Helpers&lt;/strong&gt;. So let's get back to our empty file ( &lt;em&gt;app/helpers.php&lt;/em&gt; ) and start adding some code to it as shown:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;code&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;?php&lt;br&gt;
function fontawesomeloader(){&lt;br&gt;
echo '&amp;lt;link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css"crossorigin="anonymous"&amp;gt;';&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;note&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;i prefer using &lt;strong&gt;snake-case&lt;/strong&gt; naming style for Laravel helpers.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;[3-3] &lt;br&gt;
now let's get back to our &lt;strong&gt;layout.blade.php&lt;/strong&gt; please &lt;strong&gt;Erase&lt;/strong&gt; the previous &lt;strong&gt;link tag&lt;/strong&gt; was added in &lt;em&gt;[Point: 2]&lt;/em&gt; , Then please replace it with the helpers method-name we added in &lt;em&gt;[Point: 3-2]&lt;/em&gt; &lt;strong&gt;fontawesomeloader()&lt;/strong&gt;. Now Refresh your page. And &lt;strong&gt;Ohhh nothing works&lt;/strong&gt; what's wrong ?!! &lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;laravel will throw an exception saying &lt;em&gt;it can't find any function called&lt;/em&gt; 
&lt;strong&gt;fontawesomeloader()&lt;/strong&gt;. let's fix that.&lt;/li&gt;
&lt;li&gt;remember we declare the helpers function name like this &lt;code&gt;{!! fontawesomeloader() !!}&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;[3-4] &lt;br&gt;
please goto a file within your main project directory called (&lt;em&gt;composer.json&lt;/em&gt;) , you'll find it in a directory like this (&lt;em&gt;LaravelProjectName/composer.json&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Within&lt;/strong&gt; file please search for "&lt;strong&gt;autoload&lt;/strong&gt;": { &lt;/p&gt;

&lt;p&gt;[3-5]&lt;br&gt;
now edit the code inside the &lt;em&gt;"autoload"&lt;/em&gt; object to be like the following code &lt;/p&gt;

&lt;p&gt;&lt;em&gt;code&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;"autoload": {&lt;br&gt;
        "psr-4": {&lt;br&gt;
            "App\\": "app/"&lt;br&gt;
        },&lt;br&gt;
        "classmap": [&lt;br&gt;
            "database/seeds",&lt;br&gt;
            "database/factories"&lt;br&gt;
        ],&lt;br&gt;
        "files":[&lt;br&gt;
            "app/helpers.php"&lt;br&gt;
        ]&lt;br&gt;
    }&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;note&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;we added our helper.php file location inside the &lt;strong&gt;files-Array&lt;/strong&gt; ,This is called __ Registering __ your Helpers.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Now you've registered&lt;/strong&gt; your helpers.php file and open it for random &lt;strong&gt;call/access&lt;/strong&gt; within anyfile inside your project directory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;and Oaoooo , nothing works AGAIN&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;[3-6]&lt;br&gt;
&lt;em&gt;One final&lt;/em&gt; step to turn it on forever. Please go to your &lt;strong&gt;Terminal&lt;/strong&gt;. and &lt;strong&gt;cd&lt;/strong&gt; to your &lt;strong&gt;project directory&lt;/strong&gt; then execute the following &lt;strong&gt;command&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;code&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;composer dump-autoload&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;



&lt;br&gt;
&lt;br&gt;

&lt;p&gt;[4]&lt;br&gt;
&lt;strong&gt;Ohhhh&lt;/strong&gt; FINALLY NOW IT's WORKING.&lt;br&gt;
&lt;strong&gt;Great News&lt;/strong&gt;,your &lt;em&gt;helpers&lt;/em&gt; are up and running &amp;amp; you can &lt;em&gt;easily&lt;/em&gt; add as many methods as you like. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You've done a great job&lt;/strong&gt; learning and setting up your first Laravel Helpers.&lt;br&gt;
and am very happy and proud of you.&lt;/p&gt;

&lt;p&gt;[4-1]&lt;/p&gt;

&lt;h3&gt;
  
  
  Isn't Laravel so beautiful ?
&lt;/h3&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
[5]&lt;/p&gt;

&lt;h3&gt;
  
  
  Thanks for your time and patience.
&lt;/h3&gt;

&lt;p&gt;i hope i was useful to you. please try it out and modify the code i wrote. Develop your own helpers and comment it out here if you like.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Building Components in the Beautiful Laravel</title>
      <dc:creator>Mina Farag</dc:creator>
      <pubDate>Thu, 24 Jan 2019 17:44:06 +0000</pubDate>
      <link>https://dev.to/__mfarag/building-components-in-the-beautiful-laravel-2b0g</link>
      <guid>https://dev.to/__mfarag/building-components-in-the-beautiful-laravel-2b0g</guid>
      <description>&lt;p&gt;In the beautiful &lt;strong&gt;Laravel&lt;/strong&gt; We've so many useful tools to cutdown development-time and help building scalable modern web-apps. In this tech-note i'd like to guide you through the process of building and using &lt;strong&gt;Components&lt;/strong&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  1- What are Components in Laravel?
&lt;/h4&gt;

&lt;p&gt;Components are a reusable group of elements. Like you may want to create a Navbar to be used in almost all of your web-app pages. So you build your Navbar as a Component and tell laravel to grab it whenever you need it, and for many times as you like.&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%2Fi.pinimg.com%2F564x%2F9c%2F3d%2F5b%2F9c3d5bb9a5f2486512ab65c48a9f04cc.jpg" 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%2Fi.pinimg.com%2F564x%2F9c%2F3d%2F5b%2F9c3d5bb9a5f2486512ab65c48a9f04cc.jpg" alt="step by step"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2- how do i build &amp;amp; use Components ?
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;2-1&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;First&lt;/strong&gt; of all let's create a new directory inside our Resources directory in a &lt;em&gt;Laravel project&lt;/em&gt;, So at your side you'll have something like this structure &lt;strong&gt;(resources/views/layouts/components)&lt;/strong&gt; .&lt;/p&gt;

&lt;p&gt;&lt;em&gt;2-2&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;Make&lt;/strong&gt; a new file and call it ( &lt;strong&gt;navbar.blade.php&lt;/strong&gt; ) and save it inside ' &lt;strong&gt;components&lt;/strong&gt; ' directory you've just created in step &lt;em&gt;2-1&lt;/em&gt; .&lt;/p&gt;

&lt;p&gt;&lt;em&gt;2-3&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;With&lt;/strong&gt; any IDE ,'maybe &lt;a href="https://www.sublimetext.com/" rel="noopener noreferrer"&gt;sublime&lt;/a&gt;', Please copy and paste the following bootstrap Navbar code to your file &lt;strong&gt;navbar.blade.php&lt;/strong&gt; &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;note that: i've deleted most of the navbar-tags for the reading-time but you can find the full tags code at &lt;a href="https://getbootstrap.com/docs/4.2/components/navbar/" rel="noopener noreferrer"&gt;BootStrap&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;code&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;nav class="navbar navbar-light bg-light"&amp;gt;&lt;br&gt;
          &amp;lt;a class="navbar-brand" href="#"&amp;gt;Navbar&amp;lt;/a&amp;gt;&lt;br&gt;
        &amp;lt;/nav&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;2-4&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;We've&lt;/strong&gt; created components directory , navbar file as our new component example and finally added the code to the &lt;strong&gt;navbar.blade.php&lt;/strong&gt; . Now it's time to use it. i will give you the Easy way first , then the professional way later on. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;(Easy way)&lt;/em&gt;: &lt;br&gt;
Inside any page of your project let's assume it's &lt;strong&gt;index.blade.php&lt;/strong&gt; and for sure it's inside the ' &lt;strong&gt;views&lt;/strong&gt; ' directory, Please start using the following blade-directive.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;code&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;@component('layouts.components.navbar') &lt;br&gt;
       @endcomponent&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And you did it !! , Now you've successfully created a navbar-component and used it. But if you noticed this navbar is totally &lt;strong&gt;hardCoded&lt;/strong&gt; and this is not good for building a dynamic project. So let's add some modifications to the navbar tags at &lt;strong&gt;navbar.blade.php&lt;/strong&gt; .&lt;/p&gt;

&lt;p&gt;&lt;em&gt;2-4-2&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;I Will&lt;/strong&gt; add a variable called barndName, please notice the following code modifications:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;code&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;nav class="navbar navbar-light bg-light"&amp;gt;&lt;br&gt;
          &amp;lt;a class="navbar-brand" href="#"&amp;gt; {{$brandName}} &amp;lt;/a&amp;gt;&lt;br&gt;
        &amp;lt;/nav&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;2-4-3&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;Now&lt;/strong&gt; in the &lt;strong&gt;index.blade.php&lt;/strong&gt; , I will inject the variable with a value to the component element using the same blade-directive like the following:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;code&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;@component('layouts.components.navbar')&lt;br&gt;
        @slot('brandName')&lt;br&gt;
            value and it could be anything&lt;br&gt;
        @endslot&lt;br&gt;
         @endcomponent&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;please notice the new directive &lt;strong&gt;@slot&lt;/strong&gt; , that i used to call the &lt;strong&gt;variable&lt;/strong&gt; i've created in &lt;strong&gt;navbar.blade.php&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;A More Professional Way&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;We'll&lt;/strong&gt; add a small modifications to the way we've just learned. and believe me it's not hard as it sounds. just follow my steps&lt;/p&gt;

&lt;p&gt;&lt;em&gt;2-4-4&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;Now&lt;/strong&gt; what do you think if we named our component as navbar and just call it using the blade directive like &lt;strong&gt;@navbar&lt;/strong&gt;, isn't it much easier and readable. Let's do it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;2-4-5&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;We&lt;/strong&gt; need to tell laravel that the &lt;strong&gt;@navbar&lt;/strong&gt; means the component &lt;strong&gt;navbar.blade.php&lt;/strong&gt; you've just created, So please Laravel grab it once i call it @navbar.&lt;/p&gt;

&lt;p&gt;Please go to the following file: &lt;strong&gt;(app/providers/appServiceProvider.php)&lt;/strong&gt; , and go to the function &lt;strong&gt;boot()&lt;/strong&gt; , then add the following code inside the function body&lt;/p&gt;

&lt;p&gt;&lt;em&gt;code&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;Blade::component('layouts.components.navbar','navbar');&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;the first part in brackets is the component location , and the second part is the name you wanna call it with. This process is called &lt;strong&gt;Aliasing&lt;/strong&gt;. &lt;br&gt;
now at any location in your webApp you just call your component with &lt;strong&gt;@navbar&lt;/strong&gt; .&lt;/p&gt;

&lt;p&gt;don't forget to import the &lt;strong&gt;Blade Facade&lt;/strong&gt; inside your &lt;strong&gt;appServicesProvider.php&lt;/strong&gt; . &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;OR just add this line before the class name.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;code&lt;/em&gt; &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;use Illuminate\Support\Facades\Blade;&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;2-4-6&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;Now&lt;/strong&gt; it's time to call your aliased , renamed component from any page within your webApp lets stay with &lt;strong&gt;index.blade.php&lt;/strong&gt; (go back to point &lt;strong&gt;2-4-3&lt;/strong&gt; to review the Easy way of calling your component)&lt;/p&gt;

&lt;p&gt;now you just write the following code to call your navbar component and inject data to it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;code&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;@navbar(['brandName'=&amp;gt;'Munch any value']) @endnavbar&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;WOW you've just called your component and injected data into it&lt;/strong&gt;. &lt;br&gt;
please notice the following:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;we inject data as an &lt;strong&gt;associative array&lt;/strong&gt;. ['Name']=&amp;gt;['value'] pairs.&lt;br&gt;
the &lt;strong&gt;name / key&lt;/strong&gt; must have the same spelling as the variable in your component, review step &lt;strong&gt;(2-4-2)&lt;/strong&gt;.&lt;br&gt;
if you defined more variables in your component, simply add them to your array like &lt;strong&gt;['var1'=&amp;gt;'val1','var2'=&amp;gt;'val2']&lt;/strong&gt; .&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;2-5&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;Now&lt;/strong&gt; you can easily build your own components and reuse it within any Laravel project you have just repeat the process whenever , wherever you want a component&lt;/p&gt;

&lt;p&gt;&lt;em&gt;3&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;Thanks for your time&lt;/strong&gt;, i hope i was useful to you. &lt;br&gt;
if you like my tech-note please feedback to me or give me hints on how to make it better.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>webdev</category>
      <category>php</category>
    </item>
    <item>
      <title>Wait your White-Ice</title>
      <dc:creator>Mina Farag</dc:creator>
      <pubDate>Tue, 22 Jan 2019 22:00:14 +0000</pubDate>
      <link>https://dev.to/munchvue/wait-your-white-ice-19c</link>
      <guid>https://dev.to/munchvue/wait-your-white-ice-19c</guid>
      <description>&lt;p&gt;&lt;strong&gt;Today&lt;/strong&gt; i was listening to a new episode of '&lt;strong&gt;developer Tea&lt;/strong&gt;' Podcast. At first look the topic was not-interesting in a way that i cannot resist changing the podcast player. But as an ODC holder i developed a habit of finishing whatever I've started. &lt;/p&gt;

&lt;p&gt;So i shutdown my innervoices and kept listening to the podcast.&lt;/p&gt;

&lt;p&gt;I really thanks god for not skipping this episode. The narrator was talking about something very very important in my point of view. He started with describing the water-freezing process, Yea you read it right and the smile you developed is the same as mine when i was in your shoes back then 3 to 4 hours ago.&lt;/p&gt;

&lt;p&gt;The Water-freezing process: &lt;br&gt;
imagine putting a glass of water in a transparent refrigerator, and now imagine yourself sitting in front of it. At first hour nothing really happens to the water but in your scientific mind your ideas now telling you that the heat of the water is decreasing. For the second hour nothing will happen as well the third and fourth hours. But you still waiting and the heat still decreasing unit by unit , degree after a degree.&lt;/p&gt;

&lt;p&gt;After a while almost 6 hours of sitting in the same place. you suddenly noticed the White-Ice started to appear.&lt;/p&gt;

&lt;p&gt;and after 6 hours of non-noticeable change the ICE appeared as it came out of nowhere.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jMBp6voo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/z4apss3j9ri8phlm7vnv.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jMBp6voo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/z4apss3j9ri8phlm7vnv.jpg" alt="where is your ice"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is what Continues Work Meaning. You keep up the good , hard work. While no one notice anything even you don't. But suddenly the white Ice will appear as a result of your patience , continues , gritty work.&lt;/p&gt;

&lt;p&gt;Please keep up the good work , and have patience to see your Ice.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>laravel</category>
      <category>selfdevelopment</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
