<?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: Raghunathan Srinivasan</title>
    <description>The latest articles on DEV Community by Raghunathan Srinivasan (@raghunathan).</description>
    <link>https://dev.to/raghunathan</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%2F221083%2F8165768f-d044-4f81-9f0f-c1005761a330.png</url>
      <title>DEV Community: Raghunathan Srinivasan</title>
      <link>https://dev.to/raghunathan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/raghunathan"/>
    <language>en</language>
    <item>
      <title>Track your Books</title>
      <dc:creator>Raghunathan Srinivasan</dc:creator>
      <pubDate>Tue, 14 Sep 2021 15:27:54 +0000</pubDate>
      <link>https://dev.to/raghunathan/track-your-books-50no</link>
      <guid>https://dev.to/raghunathan/track-your-books-50no</guid>
      <description>&lt;p&gt;Hey there, how is it going?&lt;/p&gt;

&lt;p&gt;I just finished up on a web app to track your reading. It's a simple, minimal, easy to use interface. You sign up or sign in and then you add books by searching (powered by google books API). You can then view all them in one place as well as edit them and delete them. &lt;/p&gt;

&lt;p&gt;The authentication and storage is powered by Firebase. &lt;br&gt;
&lt;a href="https://github.com/Raghunathan432/book-tracker"&gt;Here&lt;/a&gt; is the Github link for the project.&lt;/p&gt;

&lt;p&gt;You can play with the demo &lt;a href="https://book-tracker-323606.firebaseapp.com"&gt;here&lt;/a&gt; as well.&lt;/p&gt;

&lt;p&gt;Check it out. Feedback is much appreciated.&lt;/p&gt;

&lt;p&gt;Raghu&lt;/p&gt;

</description>
    </item>
    <item>
      <title>History Mode for vue-router in Laravel Environment </title>
      <dc:creator>Raghunathan Srinivasan</dc:creator>
      <pubDate>Wed, 18 Sep 2019 04:23:26 +0000</pubDate>
      <link>https://dev.to/raghunathan/history-mode-for-vue-router-in-laravel-environment-5amf</link>
      <guid>https://dev.to/raghunathan/history-mode-for-vue-router-in-laravel-environment-5amf</guid>
      <description>&lt;p&gt;I've been trying to implement history mode for vue-router in my project which is built on Laravel 5.8. Any advice on how to go about doing this? &lt;/p&gt;

</description>
      <category>discuss</category>
      <category>vue</category>
      <category>laravel</category>
    </item>
    <item>
      <title>Setting up Vue with Laravel for SPAs</title>
      <dc:creator>Raghunathan Srinivasan</dc:creator>
      <pubDate>Mon, 02 Sep 2019 13:41:41 +0000</pubDate>
      <link>https://dev.to/raghunathan/setting-up-vue-with-laravel-for-spas-1d0i</link>
      <guid>https://dev.to/raghunathan/setting-up-vue-with-laravel-for-spas-1d0i</guid>
      <description>&lt;p&gt;This article is going to guide you through setting up the Laravel environment to enable you to create single-page applications (SPAs) with Vue on the front end. &lt;/p&gt;

&lt;p&gt;Laravel comes with built-in support for developing the front end with Vue. In fact, Laravel's official website was also developed using Vue.&lt;/p&gt;

&lt;p&gt;Without further ado, let's begin.&lt;/p&gt;

&lt;h1&gt;
  
  
  Basic Project Setup
&lt;/h1&gt;

&lt;p&gt;We need to create a Laravel project using the command line;&lt;br&gt;
Go to your server root directory and create a new project&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rBmUmyHK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/nfyqieyk6a4gy4n77w3i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rBmUmyHK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/nfyqieyk6a4gy4n77w3i.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that's done, open the project in your browser and you should see this;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--N8AkLQUh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/kfa7dum4t7d1q09enjkj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N8AkLQUh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/kfa7dum4t7d1q09enjkj.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We've now created a Laravel project successfully. &lt;/p&gt;

&lt;h1&gt;
  
  
  The Vue Side
&lt;/h1&gt;

&lt;p&gt;Let us complete the Vue side of the setup first and then move on to the Laravel side. &lt;/p&gt;

&lt;p&gt;It is recommended that you have npm installed on your system because you will be using it to install packages all through the development process.   &lt;/p&gt;

&lt;p&gt;The heart of the Vue side is the app.js file which lies in /resources/js/app.js. &lt;br&gt;
It will contain all of the installed package imports and the Vue app configuration &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_HN65umU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/uoumpxfshn1ajeohdfp3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_HN65umU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/uoumpxfshn1ajeohdfp3.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Open app.js and remove the existing code because we will be starting from scratch. Let us first import Vue and then create an instance of a new Vue app that configures the element with id &lt;strong&gt;app&lt;/strong&gt; (will be created in the Laravel side) to be used by Vue.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4aaBT8vc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/b66x23l9bhpc80yvdwvd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4aaBT8vc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/b66x23l9bhpc80yvdwvd.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will be using vue-router to implement the SPA, so let's go ahead and install it using npm. After installing it, we will import it into our app using app.js, tell Vue to use it and then set the router variable inside the Vue instance. We will then create a &lt;strong&gt;routes.js&lt;/strong&gt; file where we will configure the routes for our application and import that inside the app.js file as well.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--D95UCu_P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/tnlfv41qninysdab0k16.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--D95UCu_P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/tnlfv41qninysdab0k16.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qGIA2x0x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/uwyo50gt3p2fo478y643.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qGIA2x0x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/uwyo50gt3p2fo478y643.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--W-kd9Zkq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/a9sxvq4xq7rsyj3rha5l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--W-kd9Zkq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/a9sxvq4xq7rsyj3rha5l.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We've now setup Vue with Vue Router. &lt;br&gt;
We will now create three components;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;App.vue&lt;/li&gt;
&lt;li&gt;Home.vue&lt;/li&gt;
&lt;li&gt;About.vue, all inside the components directory. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Before that, delete the existing components inside the components directory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8C52T1NB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/abmgro01062yoam4x0ty.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8C52T1NB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/abmgro01062yoam4x0ty.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The App.vue file is the root component of our application. It is this component that will always be loaded in the DOM and the other components (here: Home.vue and About.vue) will be loaded dynamically into it.&lt;/p&gt;

&lt;p&gt;As far as the App.vue file is concerned, we will create a navigation of sorts to dynamically switch from Home.vue and About.vue and then we will load the required component into it using the &lt;strong&gt;router-view&lt;/strong&gt; tag.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eoKEEm5C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/odtfftll24l8atn9sx7y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eoKEEm5C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/odtfftll24l8atn9sx7y.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;to&lt;/em&gt; attribute is intentionally left blank. It will be filled in once we define the routes.&lt;/p&gt;

&lt;p&gt;Now since we've defined the App component, let's go ahead and add it inside the Vue instance we created in app.js. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Wa3UW09n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/8ksnqxu3ald3dl9qsgua.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Wa3UW09n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/8ksnqxu3ald3dl9qsgua.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have now configured the Vue instance to inject the App component inside the element with id &lt;strong&gt;app&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Now, let's define the routes inside routes.js file. We're going to have two routes, one for the Home component and the other for the About component. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--f-cuYaEN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/oek5f53v2rln0nd0bse9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--f-cuYaEN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/oek5f53v2rln0nd0bse9.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After defining the routes, we need to add it to the App.vue file's router-link tag's &lt;em&gt;to&lt;/em&gt; attribute &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---HYpnCIZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/hbzmqp63oq2s1e7znrlj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---HYpnCIZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/hbzmqp63oq2s1e7znrlj.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let us now add some content in the Home.vue and About.vue files.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--u6V3tBz3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/vomsmduu97g9a5616d5f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--u6V3tBz3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/vomsmduu97g9a5616d5f.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--B_a7LpHs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/4icoyl9mof6ew4pk19gy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--B_a7LpHs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/4icoyl9mof6ew4pk19gy.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With that done, the Vue side of the setup is complete. &lt;/p&gt;

&lt;h1&gt;
  
  
  The Laravel Side
&lt;/h1&gt;

&lt;p&gt;Open /routes/web.php and change the contents as shown below to make Laravel routes to work seamlessly with Vue Router.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QGQ1DGg_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/vdwau4qg4hihg6v2ua8n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QGQ1DGg_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/vdwau4qg4hihg6v2ua8n.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we need to change the contents of /resources/views/welcome.blade.php to work with Vue. &lt;/p&gt;

&lt;p&gt;We will first delete the contents of welcome.blade.php and then replace it with our own code. &lt;/p&gt;

&lt;p&gt;We have to create an element with id &lt;strong&gt;app&lt;/strong&gt; and then inject the App component inside this element. &lt;/p&gt;

&lt;p&gt;Finally, we need to link &lt;strong&gt;app.js&lt;/strong&gt; to welcome.blade.php using the script tag.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8RTHEh8O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/vwkm6catv2jfsbk7ltvr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8RTHEh8O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/vwkm6catv2jfsbk7ltvr.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With that, the Laravel setup is also complete. &lt;/p&gt;

&lt;h1&gt;
  
  
  Demo
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FymtioRf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/0qnxfy0bhch1717e9hns.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FymtioRf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/0qnxfy0bhch1717e9hns.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9nKUd3ph--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/f7gufz6ken6htjdp9z4f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9nKUd3ph--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/f7gufz6ken6htjdp9z4f.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you for reading!&lt;/p&gt;

</description>
      <category>vue</category>
      <category>laravel</category>
    </item>
  </channel>
</rss>
