Coder Social home page Coder Social logo

creativetimofficial / vue-material-dashboard-laravel-bs4 Goto Github PK

View Code? Open in Web Editor NEW
62.0 62.0 203.0 7.39 MB

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

License: MIT License

PHP 16.34% JavaScript 4.36% HTML 0.87% Vue 22.10% CSS 0.16% Blade 2.55% SCSS 53.61%

vue-material-dashboard-laravel-bs4's People

Contributors

catalinsimionescu avatar corina-coste avatar eugentudorache avatar mariusconstantin2503 avatar marqbeniamin avatar teamupdivision avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vue-material-dashboard-laravel-bs4's Issues

api/v1/me is unauthorized on fresh install

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • [ x] I'm reporting the issue to the correct repository (for multi-repository projects)

Expected Behavior

Fresh install should be working. It is currently not functional.

Current Behavior

Fresh install gives multiple errors (api and possibly related js errors).

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. fresh install using the installation guide (backend on Apache)
  2. login on the app
  3. see js errors on console at dashboard page such as:
    [Vue warn]: Property or method "upgradeUrl" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.

found in

---> at src/pages/Dashboard/Layout/DashboardLayout.vue
at src/App.vue

4. One major error is that while it possible to log in, the json api does not work on retrieving user due to laravel auth api protection. Go to user profile page on the app and see that it is blank. See js error:
GET http://localhost/laravel-json-api/public/index.php/api/v1/me [HTTP/1.1 401 Unauthorized 43ms]

Also

  1. Serving backend on artisan for development purposes hangs on login and does not work at all per this: https://stackoverflow.com/a/59098635. This is a huge time waste and should be explicitly included in the installing guide.
  2. Laravel version is way outdated and cannot be upgraded due dependencies. This also affects laravel passport version, which is related with the reported bug.

It doesn't work.

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I'm reporting the issue to the correct repository (for multi-repository projects)

Expected Behavior

Please describe the behavior you are expecting

Current Behavior

What is the current behavior?

Failure Information (for bugs)

Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. step 1
  2. step 2
  3. you get it...

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • Device:
  • Operating System:
  • Browser and Version:

Failure Logs

Please include any relevant log snippets or files here.

Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes (SQL: alter table `users` add unique `users_email_unique`(`email`))

when trying to migrate i get this error:

Illuminate\Database\QueryException SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes (SQL: alter table users add unique users_email_unique(email))

I try to correct using this: https://laravel-news.com/laravel-5-4-key-too-long-error

but in the public function boot there is already this line LaravelJsonApi::defaultApi('v1'); so I don't know well how to handle this.
Schema::defaultStringLength(191);

If I keep both then I get this error: Symfony\Component\Debug\Exception\FatalThrowableError : Class 'App\Providers\Schema' not found

Impossible to login

I have installed the files and the database.
I success to create some data when I attempt to register (I see the record in the database) but when I try to login with [email protected]/secret and with [email protected]/secret
Nothing happen
I am runing on Laragon with php 7.2.19 and with mysql 5.7.24
When I try to inspect the login page with Chrome and look at network I got "login" with status "pending"
I checked that laravel is running on server as it indicate in my terminal Laravel development server started: http://127.0.0.1:8000
my .env in the vue-material-dashboard is having this :
VUE_APP_APP_BASE_URL=http://192.168.1.20:8081/
VUE_APP_API_BASE_URL=http://127.0.0.1:8000/api/v1

Please provide sample step 10,11 of Laravel API Project

I cannot login to Laravel API it error 400 (bad request)
please add detail for step 10,11
10.Add the "Laravel Password Grant Client" id to your .env file under the CLIENT_ID key
11.Add the "Laravel Password Grant Client" secret to your .env file under the CLIENT_SECRET key

Laragon

Assuming I use Largon
I understand that to make this work I must not use "php artisan serve" command. When I use PHP ARTISAN SERVE I get the ip:port clearly indicated which I copy and use in .env config file on the frontend Vue side.
In this case I don't get any IP, what do I enter then for variable vor VUE_APP_API_BASE_URL ?
Currently mine are this one follow:
VUE_APP_APP_BASE_URL=http://192.168.1.20:8080/
VUE_APP_API_BASE_URL=http://localhost/laravel-json-api/public/api/v1

When I try to login I get a "Invalid credentials!" but when I look into the Laragon database table I see the admin and secret passowrd properly created into table and when I try to register I get a "Oops something went wrong"

npm run dev error

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I'm reporting the issue to the correct repository (for multi-repository projects)

Expected Behavior

npm run dev not working

Current Behavior

What is the current behavior?

Failure Information (for bugs)

ERROR  Failed to compile with 1 error                                                                                              5:52:38 AM

error  in ./src/main.js

Syntax Error: Error: [BABEL] /var/www/html/laramd/vue-material-dashboard/src/main.js: @babel/preset-env: The plugins/built-ins 'es.array.iterator, es.promise, es.object.assign, es.promise.finally' passed to the 'exclude' option are not
   valid. Please check data/[plugin-features|built-in-features].js in babel-preset-env (While processing: "/var/www/html/laramd/vue-material-dashboard/node_modules/@vue/babel-preset-app/index.js.overrides[0]$0")
   at Generator.next (<anonymous>)
   at Generator.next (<anonymous>)
   at Generator.next (<anonymous>)


@ multi (webpack)-dev-server/client?http://172.16.200.96:8080/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • Device: Desktop
  • Operating System: ubuntu 18.04.5 LTS
  • Browser and Version: chrome 89.0.4389.90

Error 404 Refresh

If im on /login or any page if i refresh (f5) juts show error page 404: not found, instead of taking me to the beginning.So i need remove / path at url for return.
Any idea what is happening?

Node Version : 16.13.2
NPM Version: 8.1.2
PHP Version : 7.4

[Bug] Setting up with NGINX on UBUNTU server

Version

latest

Reproduction link

Nginx file:

server {
    listen 8080;
    
    index index.php index.html index.htm;

    server_name example.com;
    
    return 301 https://example.com$request_uri;

}

server {
    listen 443 ssl;

    server_name example.com;
    root /data/vue-material-dashboard-laravel/laravel-json-api/public;
    
    ssl_certificate /etc/nginx/ssl/cert.pem;
    ssl_certificate_key /etc/nginx/ssl/key.pem;    
	
    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-Content-Type-Options "nosniff";

    index index.php;

    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    error_page 404 /index.php;

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }

   # location ~ /\.(?!well-known).* {
   #     deny all;
   # }
}

Operating System

Ubuntu

Device

server

Browser & Version

firefox, latest

Steps to reproduce

  1. I set all up according to documentation and run npm run build.
  2. I let nginx server the laravel/public folder. I use a rather minimal nginx configration in sites-enabled folder (see nginx code above)

What is expected?

I use the npm command, output tells me to look at http://example.com:8081
Everything looks fine and login should be working with default given login

What is actually happening?

I get some sort of backend, but cannot login.
It says: "Invalid credentials"

Solution

Do you maybe have a nice example of how nginx should server the app?
I could not find anything online. I tried running vue-material-dashboard over https by adding "vue.config.js":

module.exports = {
  devServer: {
    open: process.platform === 'darwin',
    host: '0.0.0.0',
    port: 8081, // CHANGE YOUR PORT HERE!
    https: true,
    hotOnly: false,
  },
}

Then indeed everything goes through https but login does still not work. Any ideas why? Seems api does not communicatie well with vue

Additional comments

If we can let it all work on a linux server we woudl want to go and buy the PRO version eventually (after we tested it and so on)

cannot login to free material dashboard, network error. want to see free version work before purchasing

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • [x ] I am running the latest version
  • [ x] I checked the documentation and found no answer
  • [x ] I checked to make sure that this issue has not already been filed
  • I'm reporting the issue to the correct repository (for multi-repository projects)

Expected Behavior

able to log into the frontend, with user and password displayed on the login screen

Current Behavior

I can enter the user and password, and I verified that user is in the users table. when I hit "Lets Go" I get a network error.

Failure Information (for bugs)

Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. followed the install instructions listed in the vue-material-dashboard README file.
  2. did an 'npm run dev' to start up the dashboard
  3. entered in the user and password specified on the login page.
  4. get an Invalid Credentials popup, and when I Inpect the console I see the error listed above.

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • Device:macbook pro
  • Operating System:BigSur 11.2.2
  • Browser and Version:Chrome 88.0.4324.192 (x86_64)

Failure Logs

at first I got a data undefined error, trying to read response.data when an exception occurs.

when I got the data undefined error, I added a check to Login.vue to check that response and response.data is defined before accessing the data component, and I log the exception to the console, ---it is a network error.
e: Error: Network Error
at createError (createError.js?2d83:16)
at XMLHttpRequest.handleError (xhr.js?b50d:83)
xhr.js?b50d:178 POST http://localhost:3000/api/v1/login net::ERR_CONNECTION_REFUSED

got these errors before I tried to login:
GET https://static.hotjar.com/c/hotjar-99526.js?sv=7 net::ERR_NAME_NOT_RESOLVED

VM2835 analytics.js:38 POST https://stats.g.doubleclick.net/j/collect?t=dc&aip=1&_r=3&v=1&_v=j88&tid=UA-46172202-1&cid=1170637701.1614098154&jid=581385674&gjid=2097573773&_gid=344549045.1614786264&_u=SACAAEAAQAAAAC~&z=184435371 net::ERR_NAME_NOT_RESOLVED

VM2835 analytics.js:38 POST https://stats.g.doubleclick.net/j/collect?t=dc&aip=1&_r=3&v=1&_v=j88&tid=UA-46172202-22&cid=1170637701.1614098154&jid=859596022&gjid=376057807&_gid=344549045.1614786264&_u=SACAAEABQAAAAC~&z=765413393 net::ERR_NAME_NOT_RESOLVED

no file api.php console.php and web.php under routes folder

no file api.php console.php and web.php under routes folder
step

  1. run composer update
  2. error:
    routes/web.php): failed to open stream: No such file or directory
    routes/console.php): failed to open stream: No such file or directory
    routes/api.php): failed to open stream: No such file or directory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.