An open API service indexing awesome lists of open source software.

https://github.com/creativetimofficial/vue-material-dashboard-laravel-bs4

Vue SPA Material template connected to working Laravel REST API with the help of json:api standard
https://github.com/creativetimofficial/vue-material-dashboard-laravel-bs4

Last synced: about 1 month ago
JSON representation

Vue SPA Material template connected to working Laravel REST API with the help of json:api standard

Awesome Lists containing this project

README

          

# [Vue Material Dashboard Laravel BS4](https://vue-material-dashboard-laravel-bs4.creative-tim.com/?ref=mdpl-readme) [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social&logo=twitter)](https://twitter.com/home?status=Vue%20Material%20Dashboard%20Laravel%E2%9D%A4%EF%B8%8F%0Ahttps%3A//vue-material-dashboard-laravel-bs4.creative-tim.com/%20%23%vue%20%23%material%20%23design%20%23dashboard%20%23laravel%20via%20%40CreativeTim)

![version](https://img.shields.io/badge/version-1.0.0-blue.svg) ![license](https://img.shields.io/badge/license-MIT-blue.svg) [![GitHub issues open](https://img.shields.io/github/issues/creativetimofficial/vue-material-dashboard-laravel-bs4.svg?maxAge=2592000)](https://github.com/creativetimofficial/vue-material-dashboard-laravel-bs4/issues?q=is%3Aopen+is%3Aissue) [![GitHub issues closed](https://img.shields.io/github/issues-closed-raw/creativetimofficial/vue-material-dashboard-laravel-bs4/vue-material-dashboard-laravel-bs4.svg?maxAge=2592000)](https://github.com/creativetimofficial/vue-material-dashboard-laravel-bs4/issues?q=is%3Aissue+is%3Aclosed)

*Frontend version*: Material Dashboard v2.1.2. More info at https://www.creative-tim.com/product/material-dashboard

*Vue version*: Vue Material Dashboard v1.4.0. More info at https://www.creative-tim.com/product/vue-material-dashboard

![Product Image](https://s3.amazonaws.com/creativetim_bucket/products/729/original/opt_md_vuelaravel_thumbnail.jpg)

What if your frontend came not only with reusable components, but also with a reusable backend? API-driven development is more than just a buzzword and we partnered with [UPDIVISION](https://updivision.com) to prove it. Build awesome-looking apps with a flexible architecture across a variety of devices and operating systems with Vue Material Dashboard Laravel.

If you want to get more features, go PRO with [Vue Material Dashboard PRO Laravel](https://www.creative-tim.com/product/vue-material-dashboard-laravel-pro-bs4)

# Download

For the free version of the project you can either
- download the .zip file from the Creative Tim site and extract it or
- make a clone from the Github repository

You will get two project folders: one for the Laravel API project and one for the Vue frontend.

# Laravel API Setup

## Introduction

JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. It is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability.

[Click here to go to the JSON:API docs](https://explore.postman.com/api/6357/laravel-jsonapi)

## Prerequisites

### JSON:API backend
The Laravel JSON:API backend project requires a proper multi-threaded web server such as Apache/Nginx environment with PHP, Composer and MySQL.

**Do not use `php artisan serve` as it will result in stalled requests due to the single-threaded nature of the built-in PHP web server.**

We strongly recommend using [Laradock](https://laradock.io/) for Linux and Mac or [Laragon](https://laragon.org/download/) for Windows if possible.

Other options for your local environment:
- Windows: [How to install WAMP on Windows](https://updivision.com/blog/post/beginner-s-guide-to-setting-up-your-local-development-environment-on-windows)
- Linux & Mac: [How to install LAMP on Linux & Mac](https://updivision.com/blog/post/guide-what-is-lamp-and-how-to-install-it-on-ubuntu-and-macos)

You will also need to install Composer 2: [https://getcomposer.org/doc/00-intro.md](https://getcomposer.org/doc/00-intro.md)

### Vue Material frontend
The Vue Material frontend project requires a working local environment with NodeJS version 8.9 or above (8.11.0+ recommended), npm, VueCLI.

Install Node: https://nodejs.org/ (version 8.11.0+ recommended)

Install NPM: https://www.npmjs.com/get-npm

Install VueCLI: https://cli.vuejs.org/guide/installation.html

## Laravel JSON:API Project Installation

1. Navigate in your Laravel API project folder: `cd your-laravel-json-api-project`
2. Install project dependencies: `composer install`
3. Create a new .env file: `cp .env.example .env`
3. Add your own database credentials in the .env file in DB_DATABASE, DB_USERNAME, DB_PASSWORD
5. Create users table: `php artisan migrate --seed`
6. Generate application key: `php artisan key:generate`
7. Install Laravel Passport: `php artisan passport:install` and set in the .env file the CLIENT_ID and CLIENT_SECRET that you receive
8. Add your own mailtrap.io credentials in MAIL_USERNAME and MAIL_PASSWORD in the .env file

## Vue Material Dashboard Project Installation

1. Navigate to your Vue Dashboard project folder: `cd your-vue-material-dashbord-project`
2. Install project dependencies: `npm install`
3. Create a new .env file: `cp .env.example .env`
4. `VUE_APP_BASE_URL` should contain the URL of your Vue Material Dashboard Project (eg. http://localhost:8080/)
5. `VUE_APP_API_BASE_URL` should contain the URL of your Laravel JSON:API Project. (eg. http://localhost:3000/api/v1)
6. Run `npm run dev` to start the application in a local development environment or `npm run build` to build release distributables.

## Element-UI

Vue Material Dashboard json API also uses [element-ui](https://vuematerial.io/ui-elements/elevation) components, restyled to fit perfectly with the existing Material look & feel.

## Usage

Register a user or login using admin@jsonapi.com and secret and start testing the theme.

Besides the dashboard and the auth pages this theme also has an edit profile page. All the necessary files are installed out of the box and all the needed routes are added to `src\router\index.js`. Keep in mind that all the features can be viewed once you log in using the credentials provided above or by registering your own user.

### Dashboard

You can access the dashboard either by using the "**Dashboards/Dashboard**" link in the left sidebar or by adding **/home** in the URL.

### Login

The login functionality is fully implemented in our theme helping you to start your project in no time. To login into dashboard you just have to add **/login** in the URL and fill the login form with the credentials (user: **admin@jsonapi.com** and password: **secret**).

The `src\pages\Dashboard\Pages\Login.vue` is the Vue component which handles the login functinality. You can easily adapt it to your needs.

It uses the auth store located in `src\store\modules\auth.js`.

#### Login card
```

Log in











Or Be Classical



email
Email...




lock_outline
Password...



Lets Go

```

### Register

The register functionality is fully implemented in our theme helping you to start your project in no time. To register a new user you just have to add **/register** in the URL or click on register link from login page and fill the register form with user details.

The `src\pages\Dashboard\Pages\Register.vue` is the Vue component which handles the login functinality. You can easily extend it to your needs.

It uses the auth store located in `src\store\modules\auth.js`.

#### Register card
```

Register





{{ item.icon }}


{{ item.title }}



{{ item.description }}







face
Name



email
Email



lock_outline
Password



lock_outline
Confirm Password


I agree to the terms and conditions.



Get Started

```

### Profile edit

You have the option to edit the current logged in user's profile information (name, email, profile picture) and password. To access this page, just click the "**Examples/Profile**" link in the left sidebar or add **/profile** in the URL.

The `src\pages\Dashboard\Examples\UserProfile` is the folder with Vue components that handle the update of the user information and password.

#### Edit profile component
```




perm_identity


Edit Profile





Profile Photo














Remove


Select image
Change







Name









Email









Update Profile


import {ValidationError} from "@/components";
import formMixin from "@/mixins/form-mixin";

export default {
name: "edit-profile-card",

props: {
user: Object
},

components: {ValidationError},

mixins: [formMixin],

data() {
return {
avatar_img: null,
default_img: process.env.VUE_APP_APP_BASE_URL + "/img/placeholder.jpg",
file: null
}
},

methods: {

onFileChange(e) {
let files = e.target.files || e.dataTransfer.files;
if (!files.length) return;
this.createImage(files[0]);
},

createImage(file) {
let reader = new FileReader();
reader.onload = e => {
this.avatar_img = e.target.result;
this.file = file;
}
reader.readAsDataURL(file);
},

removeImage() {
this.avatar_img = null;
},

async updateProfile() {
try {
if (!this.user.profile_image) {
await this.$store.dispatch("users/upload", {user: this.user, image: this.file})
this.user.profile_image = await this.$store.getters["profile/url"]
}
await this.$store.dispatch("profile/update", this.user)
await this.$store.dispatch("alerts/success", "Profile updated successfully.")
this.user = await this.$store.getters["profile/me"]
} catch (e) {
await this.$store.dispatch("alerts/error", "Oops, something went wrong!")
this.setApiValidation(e.response.data.errors)
}

}

}
};

```

#### Edit password component

```



perm_identity


Change Password






Current Password




New Password




Confirm New Password







Change Password


import {ValidationError} from "@/components";
import formMixin from "@/mixins/form-mixin";
export default {
name: "edit-password-card",

props: {
user: Object
},

components: {ValidationError},

mixins: [formMixin],

data: () => ({
password: null,
new_password: null,
confirm_password: null
}),

methods: {
async changePassword() {

this.user.password = this.password;
this.user.password_new = this.new_password;
this.user.password_confirmation = this.confirm_password;

try {
await this.$store.dispatch("users/update", this.user)
await this.$store.dispatch("alerts/error", "Password changed successfully.")
this.user = await this.$store.getters["profile/me"]
this.$refs['password_form'].reset()
} catch (e) {
await this.$store.dispatch("alerts/error", "Oops, something went wrong!")
this.setApiValidation(e.response.data.errors)
}

}
}
};

```

## Table of Contents

* [Versions](#versions)
* [Demo](#demo)
* [Documentation](#documentation)
* [File Structure](#file-structure)
* [Browser Support](#browser-support)
* [Resources](#resources)
* [Reporting Issues](#reporting-issues)
* [Licensing](#licensing)
* [Useful Links](#useful-links)

## Versions

[](#)
[](#)
[](#)
[](#)

| HTML | Laravel |
| --- | --- |
| [![Material Dashboard HTML](https://s3.amazonaws.com/creativetim_bucket/products/96/thumb/argon-dashboard-2.jpg)](https://demos.creative-tim.com/material-dashboard/examples/dashboard.html?ref=vmdl-readme) | [![Material Dashboard Laravel](https://s3.amazonaws.com/creativetim_bucket/products/154/thumb/material-dashboard-laravel.jpg)](https://material-dashboard-laravel.creative-tim.com/?ref=vmdl-readme) |

| Vue | Vue & Laravel |
| --- | --- |
| [![Vue Material Dashboard](https://s3.amazonaws.com/creativetim_bucket/products/81/thumb/opt_md_vue_thumbnail.jpg)](https://www.creative-tim.com/product/vue-material-dashboard?ref=vmdl-readme) | [![Vue Material Dashboard Laravel](https://s3.amazonaws.com/creativetim_bucket/products/729/thumb/opt_md_vuelaravel_thumbnail.jpg)](https://www.creative-tim.com/product/vue-material-dashboard-laravel-bs4?ref=vmdl-readme) |

## Demo

| Register | Login | Dashboard |
| --- | --- | --- |
| [![Register](https://github.com/creativetimofficial/public-assets/raw/master/vue-material-dashboard-laravel/Register.png)](https://vue-material-dashboard-laravel-bs4.creative-tim.com/register?ref=vmdl-readme) | [![Login](https://github.com/creativetimofficial/public-assets/raw/master/vue-material-dashboard-laravel/Login.png)](https://vue-material-dashboard-laravel-bs4.creative-tim.com/login?ref=vmdl-readme) | [![Dashboard](https://github.com/creativetimofficial/public-assets/raw/master/vue-material-dashboard-laravel/Dashboard.png)](https://vue-material-dashboard-laravel-bs4.creative-tim.com/?ref=vmdl-readme) |

| Profile Page | Users Page | Tables Page |
| --- | --- | --- |
| [![Profile Page](https://github.com/creativetimofficial/public-assets/raw/master/vue-material-dashboard-laravel/Profile.png)](https://vue-material-dashboard-laravel-bs4.creative-tim.com/profile?ref=vmdl-readme) | [![Users Page](https://github.com/creativetimofficial/public-assets/raw/master/vue-material-dashboard-laravel/Users.png)](https://vue-material-dashboard-laravel-bs4.creative-tim.com/user?ref=vmdl-readme) | [![Tables Page](https://github.com/creativetimofficial/public-assets/raw/master/vue-material-dashboard-laravel/Tables.png)](https://vue-material-dashboard-laravel-bs4.creative-tim.com/table-list?ref=vmdl-readme)
[View More](https://vue-material-dashboard-laravel-bs4.creative-tim.com/?ref=vmdl-readme)

## Documentation
The documentation for the Vue Material Dashboard Laravel is hosted at our [website](https://vue-material-dashboard-laravel-bs4.creative-tim.com/documentation?ref=vmdl-readme).

## File Structure
```
| .browserslistrc
| .eslintrc.js
| .gitignore
| .jshintrc
| babel.config.js
| CHANGELOG.md
| package-lock.json
| package.json
| postcss.config.js
| README.md
| yarn.lock
|
+---public
| | .DS_Store
| | favicon.png
| | index.html
| |
| \---img
| | apple-icon.png
| | bg-pricing.jpg
| | bg3.jpg
| | bg9.jpg
| | card-1.jpg
| | card-2.jpg
| | card-3.jpg
| | default-avatar.png
| | favicon.png
| | image_placeholder.jpg
| | laravel-vue.svg
| | lock.jpg
| | login.jpg
| | mask.png
| | new_logo.png
| | placeholder.jpg
| | product1.jpg
| | product2.jpg
| | product3.jpg
| | register.jpg
| | sidebar-1.jpg
| | sidebar-2.jpg
| | sidebar-3.jpg
| | sidebar-4.jpg
| | vue-logo.png
| |
| \---faces
| avatar.jpg
| card-profile1-square.jpg
| card-profile2-square.jpg
| marc.jpg
|
\---src
| .DS_Store
| App.vue
| globalComponents.js
| globalDirectives.js
| main.js
| material-dashboard.js
|
+---assets
| | .DS_Store
| |
| +---css
| | demo.css
| |
| +---images
| | avatar.jpg
| |
| \---scss
| | .DS_Store
| | material-dashboard.scss
| |
| \---md
| | .DS_Store
| | _alerts.scss
| | _autocomplete.scss
| | _badges.scss
| | _buttons.scss
| | _cards.scss
| | _chartist.scss
| | _checkboxes.scss
| | _collapse.scss
| | _colors.scss
| | _dialogs.scss
| | _dropdown.scss
| | _fileinput.scss
| | _fixed-plugin.scss
| | _footers.scss
| | _forms.scss
| | _headers.scss
| | _info-areas.scss
| | _inputs-size.scss
| | _inputs.scss
| | _layout.scss
| | _misc.scss
| | _mixins.scss
| | _navbars.scss
| | _pages.scss
| | _pagination.scss
| | _pills.scss
| | _popups.scss
| | _progress.scss
| | _radios.scss
| | _responsive.scss
| | _rtl.scss
| | _select.scss
| | _shadows.scss
| | _sidebar-and-main-panel.scss
| | _tables.scss
| | _tabs.scss
| | _tags.scss
| | _timeline.scss
| | _togglebutton.scss
| | _typography.scss
| | _variables.scss
| |
| +---cards
| | _card-global-sales.scss
| | _card-login.scss
| | _card-pricing.scss
| | _card-product.scss
| | _card-profile.scss
| | _card-signup.scss
| | _card-tabs.scss
| | _card-testimonials.scss
| |
| +---mixins
| | _chartist.scss
| | _sidebar.scss
| | _transparency.scss
| | _vendor-prefixes.scss
| |
| \---plugins
| _animate.scss
| _fullcalendar.scss
| _md-datepicker.scss
| _perfect-scrollbar.scss
| _plugin-jquery.jvectormap.scss
| _plugin-nouislider.scss
| _sweetalert2.scss
| _wizard-card.scss
|
+---axios
| index.js
|
+---components
| | .DS_Store
| | Badge.vue
| | Dropdown.vue
| | index.js
| | Logout.vue
| | Pagination.vue
| | Slider.vue
| | Tabs.vue
| | ValidationError.vue
| |
| +---Cards
| | ChartCard.vue
| | LoginCard.vue
| | NavTabsCard.vue
| | SignupCard.vue
| | StatsCard.vue
| |
| +---NotificationPlugin
| | index.js
| | Notification.vue
| | Notifications.vue
| |
| +---SidebarPlugin
| | index.js
| | SideBar.vue
| | SidebarItem.vue
| |
| \---WorldMap
| WorldMap.vue
| world_map.js
|
+---middleware
| auth.js
| guest.js
|
+---mixins
| form-mixin.js
|
+---pages
| | .DS_Store
| | FixedPlugin.vue
| |
| \---Dashboard
| | .DS_Store
| | Dashboard.vue
| |
| +---Components
| | Icons.vue
| | Notifications.vue
| | Typography.vue
| |
| +---Examples
| | | UserProfile.vue
| | |
| | +---UserManagement
| | | AddUserPage.vue
| | | EditUserPage.vue
| | | ListUserPage.vue
| | |
| | \---UserProfile
| | EditPasswordCard.vue
| | EditProfileCard.vue
| | UserProfileCard.vue
| |
| +---Layout
| | | Content.vue
| | | ContentFooter.vue
| | | DashboardLayout.vue
| | | TopNavbar.vue
| | |
| | \---Extra
| | MobileMenu.vue
| | UserMenu.vue
| |
| +---Maps
| | API_KEY.js
| | FullScreenMap.vue
| |
| +---Pages
| | AuthLayout.vue
| | Login.vue
| | Register.vue
| | RtlSupport.vue
| |
| \---Tables
| RegularTables.vue
|
+---router
| index.js
| routes.js
|
\---store
| index.js
|
+---modules
| alerts-module.js
| auth.js
| categories-module.js
| items-module.js
| profile-module.js
| roles-module.js
| tags-module.js
| users-module.js
|
\---services
categories-service.js
items-service.js
profile-service.js
roles-service.js
tags-service.js
users-service.js
```

## Browser Support

At present, we officially aim to support the last two versions of the following browsers:

## Resources
- Demo:
- Download Page:
- Documentation:
- License Agreement:
- Support:
- Issues: [Github Issues Page](https://github.com/creativetimofficial/ct-vue-material-dashboard-laravel-bs4/issues)
- **Dashboards:**

| HTML | Laravel |
| --- | --- |
| [![Material Dashboard HTML](https://s3.amazonaws.com/creativetim_bucket/products/96/thumb/argon-dashboard-2.jpg)](https://demos.creative-tim.com/material-dashboard/examples/dashboard.html?ref=vmdl-readme) | [![Material Dashboard Laravel](https://s3.amazonaws.com/creativetim_bucket/products/154/thumb/material-dashboard-laravel.jpg)](https://material-dashboard-laravel.creative-tim.com/?ref=vmdl-readme) |

| Vue | Vue & Laravel |
| --- | --- |
| [![Vue Material Dashboard](https://s3.amazonaws.com/creativetim_bucket/products/81/thumb/opt_md_vue_thumbnail.jpg)](https://www.creative-tim.com/product/vue-material-dashboard?ref=vmdl-readme) | [![Vue Material Dashboard Laravel](https://s3.amazonaws.com/creativetim_bucket/products/729/thumb/opt_md_vuelaravel_thumbnail.jpg)](https://www.creative-tim.com/product/vue-material-dashboard-laravel-bs4?ref=vmdl-readme) |

## Change log

Please see the [changelog](CHANGELOG.md) for more information on what has changed recently.

## Credits

- [Creative Tim](https://creative-tim.com/?ref=vmdl-readme)
- [UPDIVISION](https://updivision.com)

## Reporting Issues

We use GitHub Issues as the official bug tracker for the Vue Material Dashboard Laravel. Here are some advices for our users that want to report an issue:

1. Make sure that you are using the latest version of the Vue Material Dashboard Laravel. Check the CHANGELOG from your dashboard on our [website](https://www.creative-tim.com/?ref=vmdl-readme).
2. Providing us reproducible steps for the issue will shorten the time it takes for it to be fixed.
3. Some issues may be browser specific, so specifying in what browser you encountered the issue might help.

## Licensing

- Copyright Creative Tim (https://www.creative-tim.com/?ref=vmdl-readme)
- Licensed under MIT (https://github.com/creativetimofficial/vue-material-dashboard-laravel-bs4/blob/master/LICENSE.md)

## Useful Links

- [Tutorials](https://www.youtube.com/channel/UCVyTG4sCw-rOvB9oHkzZD1w)
- [Affiliate Program](https://www.creative-tim.com/affiliates/new) (earn money)
- [Blog Creative Tim](http://blog.creative-tim.com/)
- [Free Products](https://www.creative-tim.com/bootstrap-themes/free) from Creative Tim
- [Premium Products](https://www.creative-tim.com/bootstrap-themes/premium?ref=vmdl-readme) from Creative Tim
- [React Products](https://www.creative-tim.com/bootstrap-themes/react-themes?ref=vmdl-readme) from Creative Tim
- [Angular Products](https://www.creative-tim.com/bootstrap-themes/angular-themes?ref=vmdl-readme) from Creative Tim
- [VueJS Products](https://www.creative-tim.com/bootstrap-themes/vuejs-themes?ref=vmdl-readme) from Creative Tim
- [More products](https://www.creative-tim.com/bootstrap-themes?ref=vmdl-readme) from Creative Tim
- Check our Bundles [here](https://www.creative-tim.com/bundles??ref=vmdl-readme)

## Social Media

### Creative Tim:

Twitter:

Facebook:

Dribbble:

Instagram:

### Updivision:

Twitter:

Facebook:

Linkedin:

Updivision Blog:

## Credits

- [Creative Tim](https://creative-tim.com/?ref=mdpl-readme)
- [UPDIVISION](https://updivision.com)