Category : vue.js

I work on a project with Laravel and VueJS. In Laravel, I use only routing API and i call them with Axios in VueJS. I want to use session but when i put a key, it is not saved. I added in middlewareGroup : ‘api’ => [ IlluminateSessionMiddlewareStartSession::class, AppHttpMiddlewareEncryptCookies::class, ‘throttle:60,1’, ‘bindings’, IlluminateRoutingMiddlewareSubstituteBindings::class ], To put ..

Read more

I’m using this code to upload files from chrome extension to the server let formData = new FormData(); this.files.forEach( (el) => { console.log(el); formData.append(‘images[]’, el); }); formData.append(‘password’, this.password); let config = { header: { ‘Authorization’: `Bearer ${this.$store.getters.userToken}`, ‘Content-Type’: ‘multipart/form-data’, }, withCredentials: true } axios.post(‘http://localhost:3000/compress’, formData, config) .then( (response) => { console.log(response, response.data); this.isLoading = false; ..

Read more

I am basically developing a twig file, I am very new to drupal 8 So previously i had a Vue file where i have this code snippet <div class="dropdown-menu":aria-labelledby="menu.class" v-if="menu.class.includes(‘dropdown’)"> Where menu.class is array of items This line will execute only if the menu.class includes the style dropdown, which is working totally fine. Now i ..

Read more

I have a custom multiple files upload using a VueJS package, on front-end works fine and the post request is done, now the problem, I am not sure how to catch that post request to store files. <file-upload extensions="jpg,jpeg,png,pdf" :accept="accept" :multiple="true" :maximum="10" post-action="/upload/post" v-model="certifications" input-id="certifications" name="certifications[]" @input-filter="inputFilter" ref="upload"> </file-upload> Sourc..

Read more

I try to follow this tutorial https://www.tutsmake.com/larave-vue-js-spa-crud-example-tutorial/ to try add data crud with laravel and vue.js but after run the code get the error View [app] not found. view folder AddPost.vue https://pastebin.com/ijJViRrm api.php Route::post(‘add’, ‘[email protected]’); app.blade.php https://pastebin.com/b9wpdF8e routes.js https://pastebin.com/3Cr74vSK app.js https://pastebin.com/KKg7xKXD App.vue https://pastebin.com/JdNkQcx1 PostController.php public function add(Request $request) { $post = new Post([ ‘title’ => ..

Read more

i have this axios post request in a vue.js instance that is working perfectly when running on local ( under xamp ), but when i try the same code online, my axios post request sends out an empty array. It is not a problem of Database access, or any issue retreiving information from this database ..

Read more

After a week of reading almost every article and SO question out there, I’ve not been able to solve this. I have: a (Php)API hosted locally on Nginx at https://api.domain.com(self signed tls certificate) Cors handling before all the routes are hit, e.g: public function headers() { if (in_array($_SERVER["HTTP_ORIGIN"], SecretsCollection::ALLOWED_ORIGINS)) { header("Access-Control-Allow-Origin: " . $_SERVER["HTTP_ORIGIN"]); } ..

Read more