News Articles laravel

COMO PEGO O VALOR DE UM IMPUT ESPEFICICO DENTROD O FOREACH [closed]

O codigo abaixo renderiza varias linhas de uma tabela com uma descrição, imput e um botao para adicionar. <tbody> @if ($estoque) @foreach ($estoque as $item) <tr> <td style="text-align: center" class="iditemLink"> {{ $item->Descricao }} </td> <td style="text-align: center"> <input class="form-control input uppercase quantidade" type="number" style="text-align: center"> </td> <td style="text-align: center"> <button type="button" data-idEstoquelink="{{$item->ID}}" class="btn btn-sm btn-edit […]

Combining Laravel + Vue.js got Error ( Module not found: Error: Can’t resolve ‘./vue/App’ in ‘C:xampphtdocstodolistresourcesjs’ )

So I did everything like this video https://www.youtube.com/watch?v=UHSipe7pSac but after that I got this error : 🙁 "ERROR in ./resources/js/app.js 4:0-28 Module not found: Error: Can’t resolve ‘./vue/app’ this is my /resources/js/app.js file require(‘./bootstrap’); import Vue from ‘vue’; import App from ‘./vue/App’; const app = new Vue( { el: ‘#app’, components: { app } } […]

How to extend Laravel with driver-based services

Hi, I’m Valerio, software engineer and CTO at Inspector. In this article I talk about a Laravel internal feature not mentioned in the official documentation called “Driver Manager”. It can completely change the way you design and develop your application solving critical architectural bottlenecks, allowing you to build large systems built around decoupled, independent and […]

Axios and Sanctum don’t create the CSRF token

I saw in the docs I need to first get a CSRF token from the API endpoint localhost:8080/sanctum/csrf-cookie: https://laravel.com/docs/8.x/sanctum#spa-configuration I do it like so: useEffect(() => { axios.get(‘http://localhost:8080/sanctum/csrf-cookie’).then(response => { console.log(JSON.stringify(response)) }); }, []); I do get the response which is: register.jsx?{"data":"","status":204,"statusText":"No Content","headers":{"cache-control":"no-cache, private"},"config":{"url":"http://localhost:8080/sanctum/csrf-cookie","method":"get","headers":{"Accept":"application/json, text/plain, /"},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false}},"request":{}} But then when I try to pass data to […]

laravel get model vuejs data false

with vue js axios i am sending get request with id from routes and using "show" function I’m trying to fetch the data that matches the account_id in the "account_id" column of the "transactions" table with the id of 5 and the id of the "accounts" table. The incoming data looks correct, but when I […]

Call laravel controller from vue file

I created a component in vue file and I want to fetch data from laravel controller function. currently, I have used axios to fetch data. But can I directly call laravel controller function? Thanks in advance. Source: Vue – Stack Overflow

Problem with javascript and laravel – Save token

i am working with push notifications, i need to save the token it generates and pass it through POST Javascript: function pedirPermiso(){ messaging.requestPermission() .then(function(){ console.log("Se han haceptado las notificaciones"); hideAlert(); return messaging.getToken(); }).then(function(token){ console.log(token); guardarToken(token); }).catch(function(err){ console.log(‘No se ha recibido el permiso’); showAlert(); }); } function guardarToken(token){ var formData=new FormData(); formData.append(‘token’,token); axios.post(‘/token’,formData).then( respuesta=>{ console.log(respuesta); }).catch( […]

how to redirect to specific page

When filling out the form I want it to redirect me to another page but I can’t get to the page. route Route::get(‘cotizacion-enviada’, function () { return view(‘quotationshippingvalid’); })->name(‘cotizacion-enviada’); controller public function store(StoreQuotationShipping $request){ $data = $request->all(); $id = QuotationShipping::create([ ‘user_id’ => $data[‘id’], //usuario alvaro por defecto ‘nombre’ => $data[‘nombre’], ‘rut’ => $data[‘rut’], ‘telefono’ => […]

Remove flash of unstyled content in a Laravel application

I am developing a simple website for cars dealership. I am new to Laravel and this is the first time I deal with such thing, actually this is the first time I see something like this in an application that I developed. So I understand the problem, the browser renders HTML before it applies CSS […]

User registration using Laravel Sanctum with fetch API call works without X-XSRF-TOKEN header, but with weird CORS error

I have a registration endpoint that works from Postman on http://localhost:8080/api/register It also works from within a React app (using Next.js framework), but I get an error message: register:1 Access to fetch at ‘http://localhost:8080/api/register’ from origin ‘http://localhost:3000’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque […]

Laravel auth routes with fallback route

I’m building a laravel app with frontend in react and admin panel in simple html. I’m having problem with accessing other pages because of fallback route(ReactJS does it’s own routing). Now if I try going to /login the login page flashes and redirects to react app. routes/web.php Auth::routes(); Route::fallback(function() { return view(‘welcome’); }); How would […]

how to change attribute name in javascript with own attribute select?

I want to change id name onclick with select id name <input id="image_id_’ + i + ‘" name="picturenum" type="text" class="deleteok col s4 m4 validate center" value="’ + i + ‘" disabled> <script> $(‘.deleteok’).on(‘click’, function () { $(‘#image_id_’ + i).attr(‘id’ , ‘image_id_’ +i-1); </script> Source: JavaSript – Stack Overflow

Inertiajs – Asynch Redirect

I have a short question. Does inertia render asynch? I realized, as soon I delete a DB – Entry, while I connect to new Nav-Link direct afterwards (onStart), the changes (onSuccess) wont be showed up. Inertia.post(‘data-delete’, { id: this.meeeh.data[index].id, }, { preserveScroll: true, onBefore: () => { window.Toast.confirm(‘Delete?’); }, onStart: (visit) => { window.Toast.load(‘Delete…’); }, […]

Trying out tensorflow/teachable machine on vuejs but stuck at error

So, I’m trying out https://teachablemachine.withgoogle.com/ with vuejs. And I come to the part where I’m exporting the model to try out in my project. I basically just slowly adjust the syntax to fit with vue and now I’m stuck at this line of the code which returns me the cannot read properties of undefined…. console.log(this.webcam.canvas); […]

When i try to add vue js in laravel shows an error -> Error: Cannot find module ‘webpack/lib/rules/DescriptionDataMatcherRulePlugin’

I am using the following code to add vue js in laravel application. composer require laravel/ui php artisan ui vue npm install npm run watch-poll npm mix "–watch" "–watch-poll" npm run development — –watch "–watch-poll" npm run dev Source: Vue – Stack Overflow

VueJS Front – Laravel API – Decrypt Error

What is the flow I send an email to a user, with a link to click. The link has this structure {{frontend}}/verify/{{user_id}}/{{hash}}?expires=1631024738&signature=SOMETHINGHERE When the user clicks the link I render this component <template> <transition name="fade"> <div class="verify-wrapper"> <div v-if="!isVerifying"> <h3> Please, check your email! </h3> <h5> If you have troubles recieveing the email, <a @click="verifyRequestClicked" […]

Payload is not valid. Vue Front Laravel API

What is the flow I send an email to a user, with a link to click. The link has this structure {{frontend}}/verify/{{user_id}}/{{hash}}?expires=1631024738&signature=SOMETHINGHERE When the user clicks the link I render this component <template> <transition name="fade"> <div class="verify-wrapper"> <div v-if="!isVerifying"> <h3> Please, check your email! </h3> <h5> If you have troubles recieveing the email, <a @click="verifyRequestClicked" […]

2 or more font weights for custom fonts in barryvdh/laravel-dompdf v 0.9.0

I am using laravel with composer installed barryvdh/laravel-dompdf v 0.9.0. I can not get anything to work and have been through the most popular posts regarding this issue, without any luck. I could probably list more, but i’ve been through the most relevant ones including this post: Custom Fonts for DOMPDF I’ve tried to match […]

Sitemap | Terms | Privacy | Cookies | Advertising

Senior Software Developer

Creator of @LzoMedia I am a backend software developer based in London who likes beautiful code and has an adherence to standards & love's open-source.