Category : vue.js

I’m working on a Laravel 8 Project with Sanctum and VueJs, and I would like to know if there is any way to send the token without write each time header in my axios request: const token = localStorage.getItem("token"); axios .get("/api/endpoint/", { headers: { "Content-Type": "application/json", Authorization: "Bearer " + token } }) .then(response => ..

Read more

Vue console error log Am getting this 422 (Unprocessable Entity) error while trying to do a POST request using Laravel and Vue-resource. I currently have the following codes: register() { this.loading = true; this.axios.post(‘register’, { firstname: this.firstname, lastname: this.lastname, email: this.email, password: this.password, password_confirmation: this.password_confirmation }) .then(response => { this.loading = false; this.name = ”; ..

Read more

I would like to add some dynamism to my blade pages. For example if I select a certain value in a select, then make certain inputs of the form appear or disappear. I told myself that this is an opportunity to put some "vue" functionnalities in my pages, to learn. To do this I followed ..

Read more

I have a step form with 3 steps and it stops at third step before submission. On debugging it is found methos not allowed exception. my code is as below if(this.step == 39){ console.log(this.readinessAssessment); console.log(this.jobSeekerId); this.showLoader = false; axios.post(‘/save-competencies’, {readinessAssessment: this.readinessAssessment, jobSeekerId: this.jobSeekerId}) .then(response => { console.log(response); if(response.data.success){ this.competenciesPart = false; this.applicationAccepted = true; setTimeout(() ..

Read more

I’m using Laravel with Chromelogger to log messages to the console in DevTools. I added this in config/logging.php: ‘chrome’ => [ ‘driver’ => ‘monolog’, ‘handler’ => MonologHandlerChromePHPHandler::class, ‘formatter’ => MonologFormatterChromePHPFormatter::class ], and set this in the .env file LOG_CHANNEL=chrome and use it like this in a controller or model : use IlluminateSupportFacadesLog; Log::info(‘This is a ..

Read more

I’m working on a small chat project, but it seems like Laravel echo is not listening, since I can see the log (message) correctly on pusher website dashboard this is my code : mounted: function(){ Echo.private(‘chat’).listen(‘MessageSent’, (e) => { console.log(e) }); }, This is my bootstrap.js file import Echo from ‘laravel-echo’; window.Pusher = require(‘pusher-js’); window.Echo ..

Read more

I have my VueJs form like this with v-model <select name="service_id" v-model="client.services[0].pivot.service_id"> <option v-for="service in services" v-bind:key="service.id" v-bind:value="service.id"> {{ service.company_name }} </option> </select> and i am sending the data in json using return Client::with(‘services’)->find($clientd); with belongsToMany in my Client and Service Model with clients_services as pivot table. I am having problem updating the form because ..

Read more

Im building SPA project and I wanna make it as customizable as can. I want to edit settings like: Title, description, Google tags, favicons, logo, settings like e-mail configs etc. In future styles or smth like that. Of course that data will be editable through admin panel. Some of config data will be fetch on ..

Read more

I want to build a client application based on Vue CLI using Axios to make requests to my API backend build with Laravel using the Sanctum Package in order to authorize requests. The error I receive is the following: Access to XMLHttpRequest at ‘http://api.webgame.test/register’ from origin ‘http://webgame.test:8080’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ ..

Read more

I deployed frontend and backend in a shared hosting. When I call api, then shows this errors in browser console. xhr.js:210 Mixed Content: The page at ‘https://front.thecomicden.com/’ was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint ‘http://back.thecomicden.com/api/allTask’. This request has been blocked; the content must be served over HTTPS. createError.js:16 Uncaught (in promise) Error: ..

Read more

I am trying to use laravel vue pagination on my vue3 typescript app https://github.com/gilbitron/laravel-vue-pagination I have installed the library and registered it on my index.ts <template> <div> <table> <tr v-for="(hub, index) in hubs" :key="index"> <td>{{ index + 1 }}</td> <td>{{ hub.name }}</td> <td>{{ hub.contact_address }}</td> </tr> </table> <pagination :data="hubs" @pagination-change-page="getResults"></pagination> </div> </template> Javascript <script lang="ts"> ..

Read more

I am trying to use laravel vue pagination on my vue3 typescript app https://github.com/gilbitron/laravel-vue-pagination I have installed the library and registered it on my index.ts <template> <div> <table> <tr v-for="(hub, index) in hubs" :key="index"> <td>{{ index + 1 }}</td> <td>{{ hub.name }}</td> <td>{{ hub.contact_address }}</td> </tr> </table> <pagination :data="hubs" @pagination-change-page="getResults"></pagination> </div> </template> Javascript <script lang="ts"> ..

Read more

I’m working on a project using Laravel and VueJs, i’m getting some data using Axios, but i’m not able to display it on my component, This my data returned : { "record": [ { "id": 1003, "name": "audreanne87", "email": "[email protected]", "email_verified_at": "2022-01-08T02:10:04.000000Z", "created_at": "2022-01-08T02:10:04.000000Z", "updated_at": "2022-01-08T02:10:04.000000Z" } ] } When I do {{ record }} ..

Read more