# Laravel Integration

Vuexy provide laravel starter-kit to speed up your laravel development with Vuexy Admin.

# Folder Structure

Once you download the template from ThemeForest, you will find the below folder structure in vuexy-vX.X/vuexy-vuejs-laravel-template/. This folder contains full version of laravel using Vuexy Vuejs Admin.

  1. vuexy-vuejs-laravel-template/
  2. ├── app # Controllers and Models
  3. ├── bootstrap # Contains cache and app.php
  4. ├── config # Application's configuration files
  5. ├── database # Migrations, model factories, & seeds
  6. ├── public # index.php ,static folder & Build
  7. ├── resources # Views, Layouts, store and vue.js components
  8. ├── assets/
  9. ├── css/
  10. ├── fonts/
  11. ├── images/
  12. └── utils/
  13. ├── js # All JS Files
  14. ├── src
  15. ├── acl/ # Vuejs Access Control
  16. ├── auth/ # Auth0 Service
  17. ├── components/ # Vuexy Admin custom components
  18. ├── fake-db/ # Fake Database for mocking API calls
  19. ├── filters/ # VueJS filters
  20. ├── firebase/ # Firebase Configuration
  21. ├── http/ # Fake Requests
  22. ├── i18n/ # Internationalization
  23. ├── layouts/
  24. ├── components/ # Layout components
  25. ├── customizer/ # Customizer components
  26. ├── horizontal-nav-menu/ # Horizontal Navigation Menu Component
  27. ├── navbar/ # Navbar for Horizontal & Vertical Layout
  28. ├── vertical-nav-menu/ # Vertical Navigation Menu Component
  29. ├── vx-tooltip/ # Extended Tooltip component
  30. ├── TheFooter.vue # Footer Component
  31. └── VxBreadcrumb.vue # Breadcrumb Component
  32. ├── full-page/ # Full page layout for pages like login
  33. └── main/ # Main layout
  34. ├── palugins/ # Vuejs Plugins
  35. ├── store/ # Vuex Store
  36. ├── vendor/ # Vendor Files
  37. ├── views/ # View files for all pages
  38. ├── App.vue # Application main vue file
  39. ├── globalComponents.js # Gloablly registered components
  40. ├── main.js # Application main js file
  41. ├── router.js # router file
  42. ├── app.js # Entry point
  43. ├── auth_config.js # Auth0 Configurations/Credentials
  44. ├── themeConfig.js # Theme Configuration File
  45. └── vue.config.js # Optional
  46. ├── lang/ # Include Languages
  47. ├── sass/ # Include scss files
  48. └── views/ # Contain Blade templates
  49. ├── routes/ # Include Routes Web.php
  50. ├── storage/ # Contains compile blade templates
  51. ├── tests/ # For testing
  52. ├── .babelrc # Babel File
  53. ├── .editorconfig # Related with your editor
  54. ├── .env.example # Include Database credentials
  55. ├── .gitattributes # Give attributes to pathnames
  56. ├── .gitignore # Files and Directories to ignore
  57. ├── .styleci.yml
  58. ├── artisan # Include artisans commands
  59. ├── composer.json # Dependencies used by composer
  60. ├── package.json # Dependencies used by node
  61. ├── phpunit.xml # Related With testing
  62. ├── server.php # For php's internal web server
  63. ├── tailwind.js # Tailwind Configuration File
  64. ├── vue.config.js # VueJS Configuration File
  65. └── webpack.mix.js # Laravel's webpack file

# Installation

Given below are the steps you need to follow, to install the vuexy-laravel-starter on your system:

Step 1: Open the terminal in your root directory(vuexy-laravel-starter) & to install the composer packages run the following command:

composer install

Step 2: In the root directory, you will find a file named .env.example rename the given file name to .env and run the following command to generate the key (and you can also edit your data base credentials here)

php artisan key:generate

Step 3: By running the following command, you will be able to get all the dependencies in your node_modules folder:

npm install

Step 4: To run the project you need to run following command in the project directory. It will compile the vue files & all the other project files. If you are making any changes in any of the .vue file then you need to run the given command again.

npm run dev

Step 5: To serve the application you need to run the following command in the project directory. (This will give you an address with port number 8000)
Now navigate to the given address you will see your application is running.

php artisan serve

To change the port address, run the following command:

php artisan serve --port=8080    // For port 8080
sudo php artisan serve --port=80 // If you want to run it on port 80, you probably need to sudo.

Watching for changes:Running npm run dev every time you make changes to file is inefficient. Hopefully there’s command so your changes can be watched and get reflected accordingly.

npm run watch

Building for Production:If you want to run the project and make the build in the production mode then run the following command in the root directory, otherwise the project will continue to run in the development mode.

npm run prod

Required Permissions
If you are facing any issues regarding the permissions, then you need to run the following command in your project directory:

sudo chmod -R o+rw bootstrap/cache
sudo chmod -R o+rw storage

# Customization

How to add a New Page:
To add a new page follow the instructions given below:
Step 1: Create a file with the extension .vue under the resources->js->src->views directory. You can also create your file under the your-page-name directory. Let’s create a TestPage for an example with filename TestPage.vue and placing the below code in that file.

<template>
    <div class="">
        <h4>Test Page Content</h4>
    </div>
</template>

Step 2: After creating file you need to declare its route where it can be served on the browser, suppose you want created page to be serve on the route http://localhost:8080/test-page . To access this page define its routes in the resources -> js -> src -> router.js file.
Vue.use(Router)
export default new Router({
mode: ‘history’,
routes: [
{
// =============================================================================
// MAIN LAYOUT ROUTES
// =============================================================================
path: ‘’,
component: () => import(‘./layouts/main/Main.vue’),
children: [
// =========================================================================
// Theme Routes
// =========================================================================
…,
{
path: ‘/test-page’,
name: ‘testPage’,
component: () => import(‘./views/TestPage.vue’),
},
],
},
]
})

import Vue from 'vue'
import Router from 'vue-router'

After defining the route you need to add a new menu in the sidebar navigation. To add the menu go to the resources->js->src->layouts->components->vxsidebar directory and open sidebarItems.js file.

export default [
...,
{
url: "/test-page",
name: "Test Page",
slug: "testPage",
icon: "MailIcon",
},

After completing these above steps you need to run the command npm run dev or npm run watch command in the project directory. After running this process you need to run the command php artisan serve . It will serve your app on the localhost.