This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import state from './state'; | |
| import actions from './actions'; | |
| import mutations from './mutations'; | |
| import noteActions from '../../note/store/actions'; | |
| Vue.use(Vuex); | |
| const noteModule = { | |
| state: {}, | |
| actions: noteActions, | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Route::prefix('api')->group(function() { | |
| Route::resource('notes', 'Api\NotesController'); // get all the notes of logged in user. | |
| Route::put('/notes/{note}/toggleFavourite', 'Api\NotesController@toggleFavourite'); // toggle favourite state of note | |
| Route::get('/users', 'Api\UsersController@index'); // gets all the users | |
| Route::get('/users/{user}/notes', 'Api\UsersController@getNotesByUser'); // get notes of a particular user | |
| Route::get('/users/{user}/getFavouriteNotesId', 'Api\NotesController@getFavouriteId'); // gets favourited notes of an user | |
| }); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import User from './components/User.vue'; | |
| const routes = [ | |
| { path: '/', name: 'user', component: User }, | |
| { path: '*', redirect: '/' }, | |
| ]; | |
| export default routes; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import Vue from 'vue'; | |
| import Vuex from 'vuex'; | |
| import VueRouter from 'vue-router'; | |
| import routes from './routes'; // user routes | |
| import store from './store'; // user store | |
| Vue.use(VueRouter); | |
| Vue.use(Vuex); | |
| // injecting the user routes to the vue router instance. | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <template> | |
| <div> | |
| <loading :loading="loading"> | |
| </loading> | |
| <flash> | |
| </flash> | |
| <nav-bar> | |
| </nav-bar> | |
| <div id="notes-list"> | |
| <div id="list-header"> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <template> | |
| <div> | |
| <!--loading component--> | |
| <loading :loading="loading"> | |
| </loading> | |
| <!--flash component--> | |
| <flash> | |
| </flash> | |
| <!--navbar component--> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import state from './state'; // note's state | |
| import actions from './actions'; //note's action | |
| import mutations from './mutations'; // note's mutation | |
| const store = new Vuex.Store({ | |
| state, | |
| actions, | |
| mutations, | |
| }); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | const routes = [ | |
| { path: '/', name: 'note', component: Note }, | |
| { path: '/create', name: 'create', component: Create }, | |
| { path: '*', redirect: '/' }, | |
| ]; | |
| export default routes; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import routes from './routes'; // user routes | |
| import store from './store/index'; // user store | |
| // injecting note routes to the vue router instance. | |
| const router = new VueRouter({ | |
| routes, | |
| }); | |
| // injecting router and store instance to the newly created vue object. | |
| const NoteApplication = new Vue({ | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | @extends('layouts.newApp') | |
| @section('script') | |
| <script src="{{ mix('build/js/noteApp.js') }}"></script> | |
| @endsection |