<?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>Forem: Ajay Yadav</title>
    <description>The latest articles on Forem by Ajay Yadav (@ajayyadav).</description>
    <link>https://forem.com/ajayyadav</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%2F507017%2F21f4d195-d37d-446c-9459-5dbf477d759b.jpg</url>
      <title>Forem: Ajay Yadav</title>
      <link>https://forem.com/ajayyadav</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ajayyadav"/>
    <language>en</language>
    <item>
      <title>Best Free Markdown to PDF Converter for Developers</title>
      <dc:creator>Ajay Yadav</dc:creator>
      <pubDate>Fri, 09 Jan 2026 14:27:59 +0000</pubDate>
      <link>https://forem.com/ajayyadav/best-free-markdown-to-pdf-converter-for-developers-kgd</link>
      <guid>https://forem.com/ajayyadav/best-free-markdown-to-pdf-converter-for-developers-kgd</guid>
      <description>&lt;p&gt;Looking for the best free Markdown to PDF converter? Learn how developers convert Markdown into clean, shareable PDFs using a fast, no-signup tool.&lt;/p&gt;




&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Markdown has become the &lt;strong&gt;default writing format for developers&lt;/strong&gt;. From README files and API documentation to blog posts and project notes, it offers speed, clarity, and portability.&lt;/p&gt;

&lt;p&gt;But Markdown alone isn’t always enough.&lt;/p&gt;

&lt;p&gt;Sooner or later, you need to &lt;strong&gt;share your content as a PDF&lt;/strong&gt; — for reports, documentation, proposals, or offline reading. That’s where a reliable &lt;strong&gt;Markdown to PDF converter&lt;/strong&gt; becomes essential.&lt;/p&gt;

&lt;p&gt;In this article, we’ll explore:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why developers rely on Markdown&lt;/li&gt;
&lt;li&gt;When converting Markdown to PDF makes sense&lt;/li&gt;
&lt;li&gt;What makes a good Markdown to PDF converter&lt;/li&gt;
&lt;li&gt;The best free tool you can start using right now&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What Is Markdown and Why Developers Love It
&lt;/h2&gt;

&lt;p&gt;Markdown is a lightweight markup language designed to be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Easy to read&lt;/li&gt;
&lt;li&gt;Easy to write&lt;/li&gt;
&lt;li&gt;Easy to convert&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Developers prefer Markdown because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It’s &lt;strong&gt;plain text&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Works perfectly with Git&lt;/li&gt;
&lt;li&gt;Keeps content clean and distraction-free&lt;/li&gt;
&lt;li&gt;Converts easily to other formats like HTML and PDF&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s why you’ll find Markdown everywhere — GitHub, documentation sites, static blogs, and developer notes.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Convert Markdown to PDF?
&lt;/h2&gt;

&lt;p&gt;While Markdown is perfect for writing, &lt;strong&gt;PDF is ideal for sharing&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Here are common reasons developers convert Markdown to PDF:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Documentation delivery&lt;/strong&gt; – Share product docs or API guides&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reports &amp;amp; proposals&lt;/strong&gt; – Send polished files to clients or teams&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Offline access&lt;/strong&gt; – Read anywhere without a browser&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Print-ready format&lt;/strong&gt; – Consistent layout across devices&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Professional presentation&lt;/strong&gt; – Clean typography and structure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A good PDF preserves your Markdown structure while making it universally accessible.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Makes a Good Markdown to PDF Converter?
&lt;/h2&gt;

&lt;p&gt;Not all converters are developer-friendly. The best ones focus on &lt;strong&gt;speed, simplicity, and output quality&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Here’s what to look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Free to use&lt;/li&gt;
&lt;li&gt;✅ No signup or account required&lt;/li&gt;
&lt;li&gt;✅ Clean and readable PDF output&lt;/li&gt;
&lt;li&gt;✅ Preserves headings, lists, code blocks, and links&lt;/li&gt;
&lt;li&gt;✅ Works directly in the browser&lt;/li&gt;
&lt;li&gt;✅ Fast conversion&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a tool slows you down or adds friction, it’s not worth using.&lt;/p&gt;




&lt;h2&gt;
  
  
  Best Free Markdown to PDF Converter for Developers
&lt;/h2&gt;

&lt;p&gt;If you want a &lt;strong&gt;simple, fast, and free&lt;/strong&gt; way to convert Markdown into PDF, try:&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://subhdev.com/markdown-to-pdf" rel="noopener noreferrer"&gt;https://subhdev.com/markdown-to-pdf&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This tool is built with developers in mind and focuses on doing &lt;strong&gt;one thing really well&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why developers choose this tool
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No signup required&lt;/strong&gt; – just paste Markdown and convert&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Free to use&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Instant PDF generation&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Clean formatting&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Works entirely in the browser&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Perfect for README files, docs, and reports&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can write your Markdown, preview it, and export a PDF in seconds.&lt;/p&gt;




&lt;h2&gt;
  
  
  Example: Convert Markdown to PDF in Seconds
&lt;/h2&gt;

&lt;p&gt;A typical workflow looks like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Write your content in Markdown&lt;/li&gt;
&lt;li&gt;Open &lt;strong&gt;&lt;a href="https://subhdev.com/markdown-to-pdf" rel="noopener noreferrer"&gt;https://subhdev.com/markdown-to-pdf&lt;/a&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Paste your Markdown content&lt;/li&gt;
&lt;li&gt;Click convert&lt;/li&gt;
&lt;li&gt;Download your PDF&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That’s it — no installations, no configuration, no distractions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Bonus: Convert Markdown to HTML Too
&lt;/h2&gt;

&lt;p&gt;Many developers don’t just need PDFs — they also want &lt;strong&gt;HTML output&lt;/strong&gt; for blogs, documentation sites, or static pages.&lt;/p&gt;

&lt;p&gt;You can convert Markdown to clean HTML here:&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://subhdev.com/markdown-to-html" rel="noopener noreferrer"&gt;https://subhdev.com/markdown-to-html&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is especially useful when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Publishing technical blogs&lt;/li&gt;
&lt;li&gt;Building documentation sites&lt;/li&gt;
&lt;li&gt;Sharing formatted content on the web&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both tools follow the same philosophy: &lt;strong&gt;fast, free, and developer-friendly&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Who Is This Tool For?
&lt;/h2&gt;

&lt;p&gt;This Markdown to PDF converter is ideal for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Developers writing documentation&lt;/li&gt;
&lt;li&gt;Open-source maintainers&lt;/li&gt;
&lt;li&gt;Technical writers&lt;/li&gt;
&lt;li&gt;Students preparing reports&lt;/li&gt;
&lt;li&gt;Product managers sharing specs&lt;/li&gt;
&lt;li&gt;Anyone who prefers Markdown over Word or Google Docs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you already write in Markdown, this tool fits naturally into your workflow.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Markdown is great for writing.&lt;br&gt;
PDF is great for sharing.&lt;/p&gt;

&lt;p&gt;The best workflow doesn’t require heavy software, paid tools, or complex setup.&lt;/p&gt;

&lt;p&gt;If you’re looking for the &lt;strong&gt;best free Markdown to PDF converter for developers&lt;/strong&gt;, try:&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://subhdev.com/markdown-to-pdf" rel="noopener noreferrer"&gt;https://subhdev.com/markdown-to-pdf&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And if you also need HTML output:&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://subhdev.com/markdown-to-html" rel="noopener noreferrer"&gt;https://subhdev.com/markdown-to-html&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Simple tools. Clean output. Built for developers.&lt;/p&gt;




&lt;h3&gt;
  
  
  Try it now and turn your Markdown into polished PDFs in seconds.
&lt;/h3&gt;

</description>
    </item>
    <item>
      <title>Convert ChatGPT Markdown Content into Beautiful HTML Code Effortlessly!</title>
      <dc:creator>Ajay Yadav</dc:creator>
      <pubDate>Tue, 25 Mar 2025 13:15:25 +0000</pubDate>
      <link>https://forem.com/ajayyadav/convert-chatgpt-markdown-content-into-beautiful-html-code-effortlessly-561h</link>
      <guid>https://forem.com/ajayyadav/convert-chatgpt-markdown-content-into-beautiful-html-code-effortlessly-561h</guid>
      <description>&lt;h1&gt;
  
  
  Convert ChatGPT Markdown Content into Beautiful HTML Code Effortlessly! 🚀
&lt;/h1&gt;

&lt;p&gt;Are you using ChatGPT to generate Markdown content and wondering how to turn it into stunning HTML? 🤔 Well, you’re in the right place! With &lt;strong&gt;&lt;a href="https://subhdev.com/markdown-to-html" rel="noopener noreferrer"&gt;SubhDev.com&lt;/a&gt;&lt;/strong&gt;, you can effortlessly convert ChatGPT’s Markdown output into &lt;strong&gt;clean, structured, and visually appealing HTML&lt;/strong&gt;—all for free! 🎉  &lt;/p&gt;




&lt;h2&gt;
  
  
  🔥 Why Convert ChatGPT’s Markdown to HTML?
&lt;/h2&gt;

&lt;p&gt;ChatGPT is an incredible tool for content generation, but often, its output is in &lt;strong&gt;Markdown format&lt;/strong&gt;. While Markdown is great for simplicity and readability, it doesn’t always work well for web publishing. Here’s why converting it to HTML is a smart move:  &lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Better Presentation&lt;/strong&gt; – HTML lets you style and format your content beautifully.&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Web-Friendly&lt;/strong&gt; – Directly integrate content into blogs, websites, or emails.&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;SEO Benefits&lt;/strong&gt; – Well-structured HTML enhances readability and indexing.&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;No More Manual Formatting&lt;/strong&gt; – Save time by auto-generating clean HTML!  &lt;/p&gt;

&lt;p&gt;With &lt;strong&gt;SubhDev&lt;/strong&gt;, you can take Markdown content from ChatGPT and turn it into &lt;strong&gt;fully formatted, mobile-friendly HTML&lt;/strong&gt; in seconds. 🚀  &lt;/p&gt;


&lt;h2&gt;
  
  
  ✍️ Steps to Convert ChatGPT Markdown to HTML
&lt;/h2&gt;

&lt;p&gt;Converting your Markdown content is super simple. Follow these quick steps:  &lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;1️⃣ Copy Markdown Content from ChatGPT&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Ask ChatGPT to generate content in &lt;strong&gt;Markdown format&lt;/strong&gt;, or simply copy Markdown-formatted text from your chat. Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# Welcome to My Blog!  &lt;/span&gt;
This is a sample Markdown text generated by ChatGPT.  
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="gs"&gt;**Bold Text**&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="ge"&gt;*Italicized Text*&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;A sample link&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;https://subhdev.com&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;2️⃣ Paste It into SubhDev’s Editor&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Visit &lt;strong&gt;&lt;a href="https://subhdev.com/markdown-to-html" rel="noopener noreferrer"&gt;SubhDev.com&lt;/a&gt;&lt;/strong&gt; and paste your Markdown content into the editor.  &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;3️⃣ Real-Time HTML Preview&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;See your beautifully formatted &lt;strong&gt;HTML preview in real time&lt;/strong&gt;! No need to guess what your final output will look like. 🎨  &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;4️⃣ Download Your HTML File&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Once satisfied, &lt;strong&gt;download the HTML file&lt;/strong&gt; instantly. No sign-ups, no hidden costs—just pure convenience! 🎁  &lt;/p&gt;




&lt;h2&gt;
  
  
  🌟 Why Choose SubhDev for Markdown to HTML Conversion?
&lt;/h2&gt;

&lt;p&gt;🚀 &lt;strong&gt;Real-Time Preview&lt;/strong&gt; – See your HTML transform instantly as you type!&lt;br&gt;&lt;br&gt;
💡 &lt;strong&gt;Free &amp;amp; User-Friendly&lt;/strong&gt; – No complicated settings; just copy, paste, and convert.&lt;br&gt;&lt;br&gt;
📱 &lt;strong&gt;Mobile-Friendly&lt;/strong&gt; – Works seamlessly across all devices.&lt;br&gt;&lt;br&gt;
💾 &lt;strong&gt;Download Ready-to-Use HTML&lt;/strong&gt; – Export your HTML file effortlessly.  &lt;/p&gt;

&lt;p&gt;Whether you're a &lt;strong&gt;developer&lt;/strong&gt;, &lt;strong&gt;writer&lt;/strong&gt;, or &lt;strong&gt;content creator&lt;/strong&gt;, SubhDev is your go-to tool for converting Markdown into &lt;strong&gt;clean, structured, and SEO-friendly HTML&lt;/strong&gt;.  &lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Converting ChatGPT’s Markdown into HTML &lt;strong&gt;doesn’t have to be a hassle&lt;/strong&gt;. With &lt;strong&gt;SubhDev&lt;/strong&gt;, it’s quick, easy, and &lt;strong&gt;100% free&lt;/strong&gt;! 😍  &lt;/p&gt;

&lt;p&gt;Ready to give it a try? &lt;strong&gt;&lt;a href="https://subhdev.com/markdown-to-html" rel="noopener noreferrer"&gt;Visit SubhDev.com now&lt;/a&gt; and transform your ChatGPT Markdown into stunning HTML!&lt;/strong&gt; 🚀  &lt;/p&gt;

&lt;p&gt;🔹 &lt;strong&gt;Say goodbye to manual conversions&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
🔹 &lt;strong&gt;Embrace clean, structured, and beautiful HTML&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
🔹 &lt;strong&gt;Make your content web-ready in seconds!&lt;/strong&gt;  &lt;/p&gt;

&lt;p&gt;👉 Try it today and level up your workflow! 🚀🔥&lt;/p&gt;

</description>
      <category>md</category>
      <category>markdown</category>
      <category>html</category>
      <category>mdtohtml</category>
    </item>
    <item>
      <title>Zip Pdf Files And Download In Laravel</title>
      <dc:creator>Ajay Yadav</dc:creator>
      <pubDate>Thu, 15 Apr 2021 15:06:18 +0000</pubDate>
      <link>https://forem.com/ajayyadav/zip-pdf-files-and-download-in-laravel-53g0</link>
      <guid>https://forem.com/ajayyadav/zip-pdf-files-and-download-in-laravel-53g0</guid>
      <description>&lt;p&gt;In this post we'll see how to create a zip file and download it in laravel.&lt;br&gt;
Let's start&lt;br&gt;
create a controller&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="n"&gt;php&lt;/span&gt; &lt;span class="n"&gt;artisan&lt;/span&gt; &lt;span class="n"&gt;make&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;controller&lt;/span&gt; &lt;span class="nc"&gt;InvoiceController&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now open InvoiceController and create a method &lt;strong&gt;downloadZip()&lt;/strong&gt;&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;App\Http\Controllers&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\Http\Request&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;InvoiceController&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Controller&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;downloadZip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;Storage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;disk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'local'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;makeDirectory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'tobedownload'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nv"&gt;$mode&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mo"&gt;0775&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// zip store here&lt;/span&gt;
        &lt;span class="nv"&gt;$zip_file&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;storage_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'app/tobedownload/invoices.zip'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nv"&gt;$zip&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="nf"&gt;ZipArchive&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="nv"&gt;$zip&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$zip_file&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="nc"&gt;ZipArchive&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;CREATE&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="nc"&gt;ZipArchive&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;OVERWRITE&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nv"&gt;$path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;storage_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'invoices'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// path to your pdf files&lt;/span&gt;
        &lt;span class="nv"&gt;$files&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="nf"&gt;RecursiveIteratorIterator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="nf"&gt;RecursiveDirectoryIterator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$path&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
        &lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$files&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nv"&gt;$name&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;// We're skipping all subfolders&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;$file&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;isDir&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="nv"&gt;$filePath&lt;/span&gt;     &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;getRealPath&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
                &lt;span class="c1"&gt;// extracting filename with substr/strlen&lt;/span&gt;
                &lt;span class="nv"&gt;$relativePath&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;substr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$filePath&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;strlen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="nv"&gt;$zip&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;addFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$filePath&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$relativePath&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="nv"&gt;$zip&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="nv"&gt;$headers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Content-Type'&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="s1"&gt;'application/octet-stream'&lt;/span&gt;&lt;span class="p"&gt;,);&lt;/span&gt;
        &lt;span class="nv"&gt;$zip_new_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Invoice-"&lt;/span&gt;&lt;span class="mf"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"y-m-d-h-i-s"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="mf"&gt;.&lt;/span&gt;&lt;span class="s2"&gt;".zip"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;response&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;download&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$zip_file&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nv"&gt;$zip_new_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nv"&gt;$headers&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;Here we are using &lt;strong&gt;ZipArchive()&lt;/strong&gt; class , you can read more about this on this &lt;a href="https://www.php.net/manual/en/class.ziparchive.php"&gt;link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now create a route, open &lt;strong&gt;web.php&lt;/strong&gt;&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;//web.php&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Http\Controllers\InvoiceController&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nc"&gt;Route&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/invoice-download'&lt;/span&gt;&lt;span class="p"&gt;,[&lt;/span&gt;&lt;span class="nc"&gt;InvoiceController&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="s1"&gt;'downloadZip'&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;And that's all... 🤗&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>vue</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Make Your Laravel Website Super Fast,Optimize Laravel Performance</title>
      <dc:creator>Ajay Yadav</dc:creator>
      <pubDate>Sun, 11 Apr 2021 16:18:45 +0000</pubDate>
      <link>https://forem.com/ajayyadav/make-your-laravel-website-super-fast-optimize-laravel-performance-p2p</link>
      <guid>https://forem.com/ajayyadav/make-your-laravel-website-super-fast-optimize-laravel-performance-p2p</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/jnGXHqWx7dQ"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;em&gt;And  Make sure you Like and subscribe&lt;/em&gt; 😉👍👍.&lt;/p&gt;

&lt;p&gt;Laravel is the best back-end framework of PHP, and many companies are choosing Laravel for their large and medium size projects. SEO is very important for every website. their are some tips you can follow to make your laravel app super fast.&lt;br&gt;
so lets begin&lt;/p&gt;
&lt;h2&gt;
  
  
  1. Use Caching in production:
&lt;/h2&gt;

&lt;p&gt;Every time you boot your laravel app , your app determines the middleware , resoles aliases, resolves route groups and identifies the controller action and parameter inputs for every single route entry. so you can think how bad it is for you app in the production.&lt;br&gt;
You can bypass the route processing by caching all routes running this&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="n"&gt;php&lt;/span&gt; &lt;span class="n"&gt;artisan&lt;/span&gt; &lt;span class="n"&gt;route&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;cache&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What about configuration caching ?? to bypass parsing your .env and config files on every app boot you should run&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="n"&gt;php&lt;/span&gt; &lt;span class="n"&gt;artisan&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;cache&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;p&gt;&lt;code&gt;use config() to access .env variables , avoid using env()&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;You don't need to compile you views every time , just use pre-compiled your blade template views, to do that run this command.&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="n"&gt;php&lt;/span&gt; &lt;span class="n"&gt;artisan&lt;/span&gt; &lt;span class="n"&gt;view&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;cache&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To cache a manifest of all of your app's events and listeners &lt;br&gt;
run :&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="n"&gt;php&lt;/span&gt; &lt;span class="n"&gt;artisan&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;clear&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;p&gt;&lt;code&gt;Recreate boostrap/cache/compiled.php&lt;/code&gt;&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="n"&gt;php&lt;/span&gt; &lt;span class="n"&gt;artisan&lt;/span&gt; &lt;span class="n"&gt;optimize&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Alert :&lt;/strong&gt;&lt;br&gt;
You need to clear the cache to reflect any new changes by using the commands&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="n"&gt;php&lt;/span&gt; &lt;span class="n"&gt;artisan&lt;/span&gt; &lt;span class="n"&gt;cache&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;clear&lt;/span&gt;
&lt;span class="n"&gt;php&lt;/span&gt; &lt;span class="n"&gt;artisan&lt;/span&gt; &lt;span class="n"&gt;view&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;clear&lt;/span&gt;
&lt;span class="n"&gt;php&lt;/span&gt; &lt;span class="n"&gt;artisan&lt;/span&gt; &lt;span class="n"&gt;route&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;clear&lt;/span&gt;
&lt;span class="n"&gt;php&lt;/span&gt; &lt;span class="n"&gt;artisan&lt;/span&gt; &lt;span class="n"&gt;clear&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;compiled&lt;/span&gt;
&lt;span class="n"&gt;php&lt;/span&gt; &lt;span class="n"&gt;artisan&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;cache&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Remove Dev dependencies from composer
&lt;/h2&gt;

&lt;p&gt;When you develop your project most probably you will be using some Dev packages to track queries or other development things , remove those packages who are not required in the production.&lt;br&gt;
just run a single command in the production&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="n"&gt;composer&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;prefer&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;dist&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;no&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;dev&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;o&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Use Redis, Memcached or dynamoDB Driver
&lt;/h2&gt;

&lt;p&gt;Choosing the right cache,queue and drivers can make a difference to application performance&lt;br&gt;
In production use in-memory cache driver.&lt;/p&gt;

&lt;p&gt;For queue jobs use Redis, SQS or Beanstalkd drivers. Database driver is not suitable in production.&lt;br&gt;
For session use Database, Redis, Memcached or DynamoDB drivers.&lt;/p&gt;
&lt;h2&gt;
  
  
  4. Queue Tasks
&lt;/h2&gt;

&lt;p&gt;Heavy tasks should be queued like sending email, connecting with third party API, uploading large file and updating your search index.&lt;/p&gt;
&lt;h2&gt;
  
  
  5. Remove unused Services:
&lt;/h2&gt;

&lt;p&gt;In laravel app you will find several services are unused in your product, go to&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;config/app.php&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
 and comment those services which are unused.&lt;/p&gt;
&lt;h2&gt;
  
  
  6. Use Laravel ORM over raw query
&lt;/h2&gt;

&lt;p&gt;Larvel comes with Eager loading (ORM) so use it , avoid writing your own raw query.&lt;/p&gt;
&lt;h2&gt;
  
  
  7. Minifying and Bundling Assets
&lt;/h2&gt;

&lt;p&gt;Laravel mix can help you here, it compiles all your CSS and provide single app.css file, thus reducing multiple HTTP requests to single.&lt;br&gt;
you can also remove unused CSS from your project by using &lt;strong&gt;laravel-mix-purgecss&lt;/strong&gt; package,&lt;br&gt;
just install it in your development project&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="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;install&lt;/span&gt; &lt;span class="nx"&gt;laravel&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;mix&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;purgecss&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;save&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;dev&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;yarn&lt;/span&gt; &lt;span class="nx"&gt;add&lt;/span&gt; &lt;span class="nx"&gt;laravel&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;mix&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;purgecss&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;dev&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;now in your&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;webpack.mix.js&lt;/code&gt;&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;mix&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;laravel-mix&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;laravel-mix-purgecss&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// ...&lt;/span&gt;

&lt;span class="nx"&gt;mix&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;resources/js/app.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;public/js&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="nx"&gt;sass&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;resources/sass/app.scss&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;public/css&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="nx"&gt;purgeCss&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>laravel</category>
      <category>php</category>
      <category>vue</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Laravel 7 Blade Components</title>
      <dc:creator>Ajay Yadav</dc:creator>
      <pubDate>Sun, 11 Apr 2021 01:57:33 +0000</pubDate>
      <link>https://forem.com/ajayyadav/laravel-7-blade-components-2gp9</link>
      <guid>https://forem.com/ajayyadav/laravel-7-blade-components-2gp9</guid>
      <description>&lt;p&gt;Blade is  a templating engine in laravel that allows you to use plan php in your view.In laravel 7 developers were introduced with new class based blade syntax for creating components. If you are familiar with VueJs components you will find the idea is same but in PHP way.&lt;/p&gt;

&lt;p&gt;By creating a blade component you are following &lt;strong&gt;DRY&lt;/strong&gt; ( don't repeat yourself) principle . it means you can reuse it in your project. &lt;/p&gt;

&lt;p&gt;So lets begin : &lt;br&gt;
first create a component by this command :&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="n"&gt;php&lt;/span&gt; &lt;span class="n"&gt;artisan&lt;/span&gt; &lt;span class="n"&gt;make&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;component&lt;/span&gt; &lt;span class="nc"&gt;Alert&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will generate two files&lt;br&gt;
 &lt;strong&gt;app\View\Components\Alert.php&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;this file handle variables and functions of the blade component.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;resources\views\components\alert.blade.php&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now you can call this component in your project by &lt;code&gt;"&amp;lt;x-alert&amp;gt;"&lt;/code&gt; , so you can see "x" is used to access component , &lt;br&gt;
now we want to pass a variable name "title" in the component&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="nt"&gt;&amp;lt;x-alert&lt;/span&gt; &lt;span class="na"&gt;title=&lt;/span&gt;&lt;span class="s"&gt;"This is title"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;/x-alert&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;now open &lt;strong&gt;"app\View\Components\Alert.php"&lt;/strong&gt; and add title variable in the class&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;App\View\Components&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\View\Component&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;Alert&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Component&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="cd"&gt;/**
     * The alert title.
     *
     * @var string
     */&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nv"&gt;$title&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="cd"&gt;/**
     * Create the component instance.
     *
     * @param  string  $title
     * @return void
     */&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;$type&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;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$title&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="cd"&gt;/**
     * Get the view / contents that represent the component.
     *
     * @return \Illuminate\View\View|\Closure|string
     */&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;render&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="nf"&gt;view&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'components.alert'&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;Now $title property is accessible in our "alert" blade component. you can define more variables here and can access it in the blade component like you can pass message or type of the alert.&lt;/p&gt;

&lt;h2&gt;
  
  
  more examples for the alert messages
&lt;/h2&gt;

&lt;p&gt;&lt;br&gt;
here we have passed two variables, "type" is similar like title we passed in above example and second is message but in the message variable we are passing a PHP variable value.&lt;/p&gt;

&lt;p&gt;now update your alert.blade.php with&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="c"&gt;&amp;lt;!-- /resources/views/components/alert.blade.php --&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;"alert alert-{{ $type }}"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    {{ $message }}
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Real life example:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- /resources/views/components/alert.blade.php --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="err"&gt;{{&lt;/span&gt; &lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="na"&gt;attributes-&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;merge(['class' =&amp;gt; 'p-6 rounded-lg shadow-lg']) }}&amp;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;"text-xl text-orange-500"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;{{ $title }}&lt;span class="nt"&gt;&amp;lt;/div&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;"mt-4"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        {{ $slot }}
    &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;p&gt;call it in your project&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="nt"&gt;&amp;lt;x-panel&lt;/span&gt; &lt;span class="na"&gt;title=&lt;/span&gt;&lt;span class="s"&gt;"Update Your Info!"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"max-w-2xl"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;I AM IN THE SLOT&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/x-panel&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thank you,🤗&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>vue</category>
    </item>
    <item>
      <title>Composer update Vs Composer Install</title>
      <dc:creator>Ajay Yadav</dc:creator>
      <pubDate>Sun, 28 Feb 2021 12:11:34 +0000</pubDate>
      <link>https://forem.com/ajayyadav/composer-update-vs-composer-install-2na1</link>
      <guid>https://forem.com/ajayyadav/composer-update-vs-composer-install-2na1</guid>
      <description>&lt;p&gt;Composer update and composer install, These two commands are very useful when you develop any project with composer packages. So Lets figure this out how these two are different from each other🤔.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/gk6QyqOSNVE"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;em&gt;And  Make sure you Like and subscribe&lt;/em&gt; 😉👍👍.&lt;/p&gt;

&lt;h2&gt;
  
  
  Composer Install
&lt;/h2&gt;

&lt;p&gt;When you run &lt;strong&gt;Composer install&lt;/strong&gt; in your terminal it reads the &lt;code&gt;composer.lock&lt;/code&gt; file and install dependencies which are mentioned in this file.&lt;br&gt;
But what if the &lt;code&gt;composer.lock&lt;/code&gt; file does not exists. So, In this case it reads the &lt;code&gt;composer.json&lt;/code&gt; file and install the dependencies then creates the &lt;code&gt;composer.lock&lt;/code&gt; file.&lt;/p&gt;

&lt;h3&gt;
  
  
  When to run &lt;code&gt;composer install&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;In production you need only those dependencies which you have used in development phase, And those dependencies can be found with their exact version in &lt;code&gt;composer.lock&lt;/code&gt; file. So this command is mainly used in production.&lt;br&gt;
you can use it in development phase also.😎&lt;/p&gt;

&lt;h2&gt;
  
  
  Composer update
&lt;/h2&gt;

&lt;p&gt;When you run &lt;strong&gt;composer update&lt;/strong&gt; command it simply process the &lt;code&gt;composer.json&lt;/code&gt; file and install dependencies, And creates the &lt;code&gt;composer.lock&lt;/code&gt; file with updated dependencies.&lt;/p&gt;

&lt;p&gt;It does not process the &lt;code&gt;composer.lock&lt;/code&gt; file , but it updates the dependencies version in the lock file.&lt;/p&gt;

&lt;h3&gt;
  
  
  When to run &lt;code&gt;composer update&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;composer update&lt;/strong&gt; command should be used only in development phase of the project. Because It updates the dependencies and also update the &lt;code&gt;composer.lock&lt;/code&gt; file.&lt;br&gt;
If you run this command in production it can break your code, because it'll update the dependencies which is not good in production because version may change 🤷‍♂️. &lt;/p&gt;

</description>
      <category>php</category>
      <category>laravel</category>
      <category>programming</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Type casting in Laravel</title>
      <dc:creator>Ajay Yadav</dc:creator>
      <pubDate>Tue, 23 Feb 2021 00:40:49 +0000</pubDate>
      <link>https://forem.com/ajayyadav/type-casting-in-laravel-4npm</link>
      <guid>https://forem.com/ajayyadav/type-casting-in-laravel-4npm</guid>
      <description>&lt;p&gt;Casting a value means changing it to (or ensuring it is already) a particular type. Some types you might be familiar with are &lt;code&gt;Integer&lt;/code&gt; or &lt;code&gt;Boolean&lt;/code&gt;. &lt;br&gt;
Simply put, &lt;strong&gt;type casting&lt;/strong&gt; is a method of changing an entity from one data type to another.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why should I care about type casting :
&lt;/h2&gt;

&lt;p&gt;So, When you store numbers in database - they are returned as string by default. But type casting allows you to cast them as &lt;code&gt;integer&lt;/code&gt;, &lt;code&gt;real&lt;/code&gt;, &lt;code&gt;float&lt;/code&gt; or &lt;code&gt;Boolean&lt;/code&gt; you can convert &lt;code&gt;1&lt;/code&gt; and &lt;code&gt;0&lt;/code&gt; in your database to &lt;code&gt;true&lt;/code&gt; and &lt;code&gt;false&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Let's do it ...
&lt;/h2&gt;

&lt;p&gt;So in your model you can write :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;protected $casts =  [
    'status' =&amp;gt; 'boolena',
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It'll convert status(1,0) to &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;. so when you fetch any data from table it'll convert status column to true or false. you don't need to write any logic like this ...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if($post-&amp;gt;status == "1"){
   // show status active 
}else{
   // show status inactive
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Array &amp;amp; JSON Casting
&lt;/h2&gt;

&lt;p&gt;Additionally, if your table consist a column which stores serialized JSON string and you want that particular column to be automatically deserialize the attribute to a PHP array when you access it on your Eloquent model, you should use array cast. You can do it like this.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F17du5z7nvf47f51objgf.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F17du5z7nvf47f51objgf.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, you can store JSON tags data into post table , but while fetching the posts you can convert it automatically into PHP array so now you can avoid creating tags table.&lt;/p&gt;

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

&lt;p&gt;As you can see, Eloquent attribute casting has a ton of potential to free us up from unnecessary repetitive logic, and also sneakily makes it a lot easier to store data in JSON in our database. Good Stuff!&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Most Important Topics of VueJs Router</title>
      <dc:creator>Ajay Yadav</dc:creator>
      <pubDate>Sun, 31 Jan 2021 05:39:46 +0000</pubDate>
      <link>https://forem.com/ajayyadav/most-important-topics-of-vuejs-router-3f94</link>
      <guid>https://forem.com/ajayyadav/most-important-topics-of-vuejs-router-3f94</guid>
      <description>&lt;p&gt;In this tutorial we will learn every important topic of vuejs router , we will cover most of the important topics which will help you to understand batter. I assume you already familiar with vuejs router. &lt;/p&gt;

&lt;h2&gt;
  
  
  Dynamic routing
&lt;/h2&gt;

&lt;p&gt;if you want to pass slug or id in particular vue page then dynamic routing can help you.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fx3ek4oofezt5mnj9vnw6.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fx3ek4oofezt5mnj9vnw6.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here ArticleDetail is a vue page or template where we write everying about the article detail. so we can access slug in that page with the help of '$route.params.slug'; and also we can make little bit deep routing also /user/:username/article/:articlce_id&lt;/p&gt;

&lt;h3&gt;
  
  
  Reacting to Params Changes
&lt;/h3&gt;

&lt;p&gt;If you show details of article pages and on the same page you want to list other articles in carousel and after the clicking that carousel you want to change the content of the article according to slug.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyvtenqhrd36dmytt031q.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyvtenqhrd36dmytt031q.png" alt="Alt Text"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  Catch all (404 Not found Route)
&lt;/h3&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fp2w04li567gtjzs2fi4f.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fp2w04li567gtjzs2fi4f.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Write it at the end of the all routes&lt;/p&gt;
&lt;h2&gt;
  
  
  Nested Routes
&lt;/h2&gt;

&lt;p&gt;Composed of components that are nested multiple levels deep.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fnbugom4nhcm4vycg6ssi.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fnbugom4nhcm4vycg6ssi.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note that nested paths that start with / will be treated as a root path&lt;/em&gt;&lt;br&gt;
In the user template we need to write&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;&amp;lt;router-view /&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
 so the children routes templates will be displayed in the user template.&lt;/p&gt;
&lt;h2&gt;
  
  
  Programmatic Navigation
&lt;/h2&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fivig4egb144efcifu2kq.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fivig4egb144efcifu2kq.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Named Routes
&lt;/h2&gt;

&lt;p&gt;You can give a route a name in the routes options while creating the Router instance:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;{path: '/user/:userId',name: 'user',component: User}&lt;/code&gt;&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;router-link :to="{ name: 'user', params: { userId: 123 }}"&amp;gt;User&amp;lt;/router-link&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Redirect routes
&lt;/h2&gt;

&lt;p&gt;Redirecting is also done in the routes configuration. To redirect from /a to /b&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;{ path: '/a', redirect: '/b' }&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Global Before Guards
&lt;/h2&gt;

&lt;p&gt;Global before guards are called in creation order, whenever a navigation is triggered. Guards may be resolved asynchronously, and the navigation is considered pending before all hooks have been resolved. This will help you to privatised some routes. &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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyu1tzvl77xb0tuamppui.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyu1tzvl77xb0tuamppui.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;now in the routes.js file we can add meta fields, which route needs to be authenticated.Helpful for authentication&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{ path: '/foo',component: Foo,meta: { requiresAuth: true }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Scroll Behavior
&lt;/h2&gt;

&lt;p&gt;So when you navigate to another page you want to control scroll behaviour , like when user enters on the page you want to scroll on the top of the page you can define it in routes.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3txom8h56hbtxjqcsgg6.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3txom8h56hbtxjqcsgg6.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can add active class also with the help of vue router.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lazy loading
&lt;/h2&gt;

&lt;p&gt;When building apps with a bundler, the JavaScript bundle can become quite large, and thus affect the page load time. It would be more efficient if we can split each route's components into a separate chunk, and only load them when the route is visited.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjex73js6b1m21ad836t2.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjex73js6b1m21ad836t2.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vue</category>
      <category>javascript</category>
      <category>vuejsrouter</category>
    </item>
    <item>
      <title>Laravel Jetstream vs Breeze vs Laravel/ui</title>
      <dc:creator>Ajay Yadav</dc:creator>
      <pubDate>Sat, 30 Jan 2021 14:02:37 +0000</pubDate>
      <link>https://forem.com/ajayyadav/laravel-jetstream-vs-breeze-vs-laravel-ui-4e39</link>
      <guid>https://forem.com/ajayyadav/laravel-jetstream-vs-breeze-vs-laravel-ui-4e39</guid>
      <description>&lt;p&gt;In this tutorial we will discuss about jetstream, Breeze and Laravel/ui package and We will see how they are different from each other.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/tyVszXvjQCI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;em&gt;And  Make sure you Like and subscribe&lt;/em&gt; 😉👍👍.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Jetstream??
&lt;/h2&gt;

&lt;p&gt;Jetstream is not a package or administration dashboard that you will update in the future. It is a starter kit scaffolding for laravel and after installation the templates are yours to maintain. Now you can modified according to your requirement. The authentication portion of jetstream is powered by laravel fortify.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use Jetstream if:
&lt;/h3&gt;

&lt;p&gt;1.You're familiar with Laravel Livewire, Inertia and Tailwind, or &lt;br&gt;
  don't mind spending time learning them and;&lt;br&gt;
2.You want immediately start building the core functionality of &lt;br&gt;
  your app without investing much time in boilerplate.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Laravel/ui??
&lt;/h2&gt;

&lt;p&gt;if you want to use laravel 8 with vue or react you can use it with laravel/ui package . I believe you already know about laravel/ui package. It provides a quick way to scaffold all of the routes and views you need for authentication and includes preset for Vue or React with bootstrap.&lt;/p&gt;

&lt;h3&gt;
  
  
  When to use Laravel/ui:
&lt;/h3&gt;

&lt;p&gt;1 . You want to use vuejs , reactjs and bootstarp in your &lt;br&gt;
    application.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Breeze??
&lt;/h2&gt;

&lt;p&gt;Laravel Breeze is small version of jetstream which provides you Auth system with laravel blade and Tailwind css. Laravel Breeze is the latest scaffold package released, offering a more up-to-date version of laravel/ui. It provides the same authentication functionality as laravel/ui, but uses Tailwind instead of Bootstrap, and does not include presets for Vue or React.&lt;br&gt;
Breeze does not use Fortify under the hood, but instead publishes controllers to your app so they're easier to modify (like the laravel/ui package).&lt;/p&gt;

&lt;h3&gt;
  
  
  When to use Breeze:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;You just want a more up-to-date laravel/ui.&lt;/li&gt;
&lt;li&gt;You'd like to modify the authentication functionality of your 
app quickly.&lt;/li&gt;
&lt;li&gt;You're building an app from the ground up that doesn't 
requires the features that Fortify or Jetstream provide.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>php</category>
      <category>laravel</category>
      <category>vue</category>
    </item>
    <item>
      <title>Learn JSON in 5 Minutes</title>
      <dc:creator>Ajay Yadav</dc:creator>
      <pubDate>Sat, 02 Jan 2021 04:00:07 +0000</pubDate>
      <link>https://forem.com/ajayyadav/learn-json-in-5-minutes-8ee</link>
      <guid>https://forem.com/ajayyadav/learn-json-in-5-minutes-8ee</guid>
      <description>&lt;p&gt;JSON Stands for JavaScript Object Notation, It is lightweight format for storing and transporting data through API from server to a web page. It is also 'self describing' and easy to understand.&lt;/p&gt;

&lt;p&gt;Example:&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ff7nlszlci7zukomhqpa7.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ff7nlszlci7zukomhqpa7.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  JSON Data types :
&lt;/h1&gt;

&lt;h2&gt;
  
  
  1. JSON Strings
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{ "name":"Ajay"}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here "name" is a key and "Ajay" is its &lt;br&gt;
   value.&lt;/p&gt;
&lt;h2&gt;
  
  
  2. JSON Numbers
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; { "Age":34}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Here "Age" is a key and 34 is value, which is a &lt;br&gt;
   number type.&lt;/p&gt;
&lt;h2&gt;
  
  
  3. JSON Objects
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{ "friends":[
        {
            "name":"Shyam singh",
            "age":25,
            "email":"ram@gmail.com"
        },
        {
            "name":"Rahul roy",
            "age":26,
            "dob":"23/12/1996",
            "isFriend":true
        }
    ] }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;here "friends" is a key and its values are in array data type &lt;br&gt;
   which contains two objects. His first friend is shyam and &lt;br&gt;
   second frind is Rahul. &lt;/p&gt;
&lt;h2&gt;
  
  
  4. JSON Arrays
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{"hobbies":["Learn to code", "Paint", "Blogging", "Writing"]}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Here "hobbies" is a key and it has multiple values in array &lt;br&gt;
    format separated by commas.&lt;/p&gt;
&lt;h2&gt;
  
  
  5. JSON Booleans
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"isFriend":true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Here "isFriend" is a key and its value in Boolean format which &lt;br&gt;
   can be either true or false.&lt;/p&gt;
&lt;h2&gt;
  
  
  6. JSON Null
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{"middlename":null}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;"middlename" is a key and its value in null format. if something has no value than we can assign null to its value for example some people have no middle name in that case we can assign null value.&lt;/p&gt;

&lt;p&gt;A common use of JSON is to exchange data to/from a web server. When receiving data from a web server, the data is always in string format.&lt;br&gt;
Parse the data with &lt;strong&gt;JSON.parse()&lt;/strong&gt; and the data become javaScript object.&lt;br&gt;
_&lt;em&gt;Example _&lt;/em&gt; ( data coming from a web server )&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;'{ "name":"Ajay", "city":"New Delhi"}'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the data is in string format now we need to convert it into javaScript Object by using &lt;strong&gt;JSON.parse()&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var obj = JSON.parse('{ "name":"Ajay", "city":"New Delhi"}');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we can use &lt;/p&gt;

&lt;p&gt;Thank you,&lt;/p&gt;

</description>
      <category>json</category>
      <category>javascript</category>
      <category>restapi</category>
      <category>dataformate</category>
    </item>
  </channel>
</rss>
