Category : reactjs

I apologize if this might not be the correct platform to ask this question. I need to start a new project. Laravel backend, ReactJS frontend. Im really struggling to find out which authentication system to use. I did read that a good approach might be setting up Laravel Fortify as a back-end and using Laravel ..

Read more

This is my error. xhr.js:210 POST http://localhost:8000/api/addproduct 500 (Internal Server Error) AddProduct.js:18 Error: Request failed with status code 500 at createError (createError.js:16) at settle (settle.js:17) at XMLHttpRequest.onloadend (xhr.js:66) My post request from react component(AddProduct) for post request, I used axios. and get this error not posting data to DB. const formData = new FormData(); formData.append("name", ..

Read more

I have the following component (it is just some wrapper on Select and inside this Component most of properties are assigned to <Select> component): <FormSelectNative options={games} valueKey="id" labelKey="name" onChange={handleGameSelect} defaultValue={games[0].id} /> And here is handleGameSelect method that is run onChange Select event. It loads data new data. const handleGameSelect = event => { axios.get(`/games/${event.target.value}`).then(function (response) ..

Read more

I want to integrate Veriff SDK into the react js application which has SSR also enabled. i am getting on just importing the package, rest is behind. documentation: https://developers.veriff.com/#adding-js-sdk can someone help me to integrate this veriff component in react js-laravel website ? import React, { useState, useEffect } from ‘react’; import Veriff from ‘@veriff/js-sdk’; ..

Read more

I have used Laravel to create API and used ReactJs and Redux for the frontend. When I use ‘auth‘ or ‘auth:api‘ as middleware for "Logout route", then API always returns response 401 when requested from the frontend but working fine when requested from POSTMAN. Login, Register route working fine both from POSTMAN and frontend (Browser). ..

Read more

I’m new to react and I’m using an authentication example that controls user permissions using casl/ability. In the example, an authentication in JWT is presented that reads the following JSON structure: users: [ { id: 1, fullName: ‘John’, username: ‘john’, password: ‘admin’, email: ‘[email protected]’, role: ‘admin’, ability: [ { action: ‘manage’, subject: ‘all’ } ] ..

Read more

I have an application that ueses Laravel as backend and React as frontend The two applications are stored in separate repositories. In local enviroment I serve the Laravel application with "php artisan:serve" and the React application with "npm run start". The two applications communicates with each others through POST/GET APIs. Now I want to create ..

Read more

Ive been learning Laravel, with reactJS. After checking out google, i was unable to find an answer that actually answered the question. Is using double braces good to use in style tag using laravel? I use VCS editor. <div class="overflow-hidden h-2 mb-4 text-xs flex rounded bg-gray-900"> <div style="width: {{ (Auth::user()->energy / Auth::user()->max_energy)*100 }}%" class="shadow-none flex ..

Read more

I built Laravel APIs and hosted on namecheap. I have set up the handleCORS file with these attributes: ‘paths’ => [‘api/*’], ‘allowed_methods’ => [‘*’], ‘allowed_origins’ => [‘*’], ‘allowed_origins_patterns’ => [‘*’], ‘allowed_headers’ => [‘*’], ‘exposed_headers’ => [], ‘max_age’ => 0, ‘supports_credentials’ => true, On the frontend, my requests are made using axios with the only header ..

Read more