Category : vue.js

I have a Laravel-Vue application that has the function of displaying "projects" stored in a MySQL db. These are complicated objects which are retrieved with the following query via Eloquent: return $this->load([ ‘projectVersions’ => function($query) { $query->with([ ‘values’ => function($valueQuery) { $valueQuery->with([ ‘grid’ => function($gridQuery) { $gridQuery->with([‘gridCols’, ‘gridRows.gridCells’ => function($cellQuery) { $cellQuery->with([‘gridCol’, ‘gridRow’, ‘grid’ => ..

Read more

Let’s say that I have a couple of components for my web page. Which method is better for retrieving data for a component? Method 1. Inside blade: <my-map :node-list="{{ json_encode($nodes) }}"></my-map> And then interact with it on the Vue component. The Controller would look like this: public function index() { $nodes = Node::all(); return view(‘map’)->with(‘nodes’, ..

Read more

I’ve been trying to load all of my data when the time I log in. Currently, I’ve only managed to display data through the console through vuex file. I just want to achieve this because wherever it loads all data when login, it will easier for me to call every function on every page. I ..

Read more

Im trying to create a test, each test has an image(file) and one or more questions, and each question has an (file) and one or more choices… each questions has questions_text and questions_file and questions_choices(array of objects) this is my data() function: data(){ return{ succees:false, numberQuestions:null, file:null, questions_counter:1, categories:[], form: new Form({ test_type:’1′, test_name:”, test_description:”, ..

Read more

I have created a RESTful API with lumen and tested it with postman. It works fine. Now I wanna develop the front end for it with Vue. What is the best way to go about it? Do I need to create a separate directory for Vue or is there a way to use it in ..

Read more

I am trying to display image stored in storage/app/public/images folder with VueJS but somehow the image is not displayed in vue file <img v-bind:src="img" /> export default { data(){ return{ img:”, }; }, mounted() { axios.get(‘/api/image’) .then(res => { this.img = res.data }) .catch(error => console.log(error)) }, The path returned is correct, however the image ..

Read more

I’m working with Laravel Homestead and I’m trying to install npm in order to use VUE.js I’ve got this error: npm ERR! code EPROTO npm ERR! syscall symlink npm ERR! path ../@babel/parser/bin/babel-parser.js npm ERR! dest /home/vagrant/code/agenda/node_modules/.bin/parser npm ERR! errno -71 npm ERR! EPROTO: protocol error, symlink ‘../@babel/parser/bin/babel-parser.js’ … npm ERR! A complete log of this ..

Read more

I using: VueJS 2 Laravel 8 Larvel Sanctum Laravel Mix and want to check auth before enter to page I used this answer for realease auth check, but with AdminLTE3 Preloader preloader freeze and site doesn’t loading Vuex store: const store = new Vuex.Store({ state:{ user: false, isCheckedAuth: false }, mutations:{ auth(state, payload){ state.user=payload; state.isCheckedAuth ..

Read more

I’m trying to make vuetify components to work in my laravel app but I’m getting this error: [Vue warn]: Unknown custom element: – did you register the component correctly? For recursive components, make sure to provide the "name" option. My app.js: require(‘./bootstrap’); import Vue from ‘vue’ import Vuetify from ‘vuetify/lib’ import ‘vuetify/dist/vuetify.min.css’; Vue.use(Vuetify); Vue.component(‘example-component’, require(‘./components/ExampleComponent.vue’).default); ..

Read more

use this package for API data pagination but it’s not working. data fetch but pagination not work. here is the templet I am beginner level of vue laravel & api development <template><div id="home"> <div class="container py-3"> <div class="row py-2"> <div class="col-md-3 col-lg-3 col-sm-12 mb-2" v-for="(movie,index) in movies.results" :key="index" > <!– Card –> <div class="card"> <!– ..

Read more

I’m building a SPA with Laravel and Vue. However, I need to make an API call with axios but it’s not working. Here’s my web.php: Route::get(‘/{any}’, function () { return view(‘index’); })->where(‘any’, ‘.*’); Here’s my api.php route: Route::get(‘/notification’, ‘[email protected]’); Whenever I make an API call, it shows a blank or broken page. Could you please ..

Read more

I use this package for API data pagination but it’s not working. data fetch but pagination not work. here is the templet I am beginner level of vue laravel & api development <template><div id="home"> <div class="container py-3"> <div class="row py-2"> <div class="col-md-3 col-lg-3 col-sm-12 mb-2" v-for="(movie,index) in movies.results" :key="index" > <!– Card –> <div class="card"> ..

Read more

I have a header and a home page in which I want to use Vue. I have the following setup: app.js: require(‘./bootstrap’); import Vue from ‘vue’; Vue.component(‘search’, require(‘./components/Search’).default); const header = new Vue({ el: ‘#header’ }) home.js: require(‘./bootstrap’); import Vue from ‘vue’; Vue.component(‘search-by-car’, require(‘./components/SearchByCar’).default); const searchByCar = new Vue({ el: ‘#search-by-car’ }) Of course the ..

Read more

{"message":"The given data was invalid.","errors":{"category_image":["The category image must be an image.","The category image must be a file of type: jpeg, png, jpg, gif, svg.","The category image may not be greater than 2048 characters."]}} this message shows every time even when I upload .jpg/.png/.jpeg file my validation code: $request->validate([ ‘category_name’ =>’required|min:3|max:20|unique:categories’, ‘publication_status’=>’required’, ‘category_image’ =>’required|image|mimes:jpeg,png,jpg,gif,svg|max:2048′, ]); my ..

Read more

I have Laravel 8 and Vue project uploaded on a different domain Laravel domain: https://laravel.com/api Vue domain: https://vue.com When I test this https://laravel.com/api/login link on postman it works and gives me the access_token but in Vue it shows this error in console: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at ..

Read more

I’m using laravel backend and nuxtjs frontend, when I send a login request I get a response includes the logged in user informations with a token, the response looks like this: {"message":"success","token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiNzFkYjA1MWM2MTYxMmE4YzAyNWI2YjU3N2xMzJiNzJjMjI0MzRlY2IzNzYwNTg2N2NjOWQ5ZWEwY2MiMJM3uYEiZ8GSlPlQhIctVErO2KzwXOBxifWWoM7et_qT-mgvfsk3ljwiQF9iPQw-WeekBx8J8lcmxDLESa3tfE1Re1Xk2flkcBLmiI4JN2YHh08U1U","user":{"id":1,"role_id":4587,"firstname":"Hans","lastname":"newman","email":"[email protected]","email_verified_at":null,"phone":"89498","skype":"gdgdfg","birthdate":"2021-05-02","address":"asdfaf","postalcode":14984,"city":"jisf","country":"isfisf","status":"mfof","created_at":"2021-06-16T09:33:08.000000Z","updated_at":"2021-06-16T09:39:41.000000Z","image":"1623835988-carlsen.png","description":"sfdgg","geo_lat":5.5,"geo_lng":8.1}} after logging in I want to redirect the user to his profile page where he can see his data, how can I get ..

Read more