Attendance System using Arduino and Laravel #139861
Unanswered
Migs00
asked this question in
Programming Help
Replies: 3 comments 2 replies
-
I'll give it a try and let you know. Much appreciated!
…On Sat, Sep 28, 2024 at 6:37 PM Ritu Khwalapala ***@***.***> wrote:
try disabling CSRF for your API routes. In
app/Http/Middleware/VerifyCsrfToken.php, add your API route to the $except
array:
protected $except = [
'api/your-rfid-route',
];
which is not recommended though but there are situations where you might
need to disable CSRF protection, especially when working with API routes or
external clients like Arduino devices, which do not deal with session-based
authentication and CSRF tokens. but also other routes will still have CSRF
protection enabled unless they are also added to the $except array. by
doing this, the issue should resolve. let me know how it goes. btw i myself
am not expert but i tried digging into internet for the solution and that's
what i found out. hope it helps.
—
Reply to this email directly, view it on GitHub
<#139861 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BH2WFSPPHP66PSCAQT6BDPTZY2BINAVCNFSM6AAAAABO5MKRQGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTANZYGI4DSNI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
In app/Http/Middleware/VerifyCsrfToken.php, I don't have this in my project file, Im using laravel 11, probably because I have api.php on my routes. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Body
So my team is working on a HRIS project and we have RFID as part of the system, problem is, we can't connect the Arduino to Laravel. I have this error on arduino saying error in sending http post request -1, I already checked the api.php and added the post request in there. I also tried it with php only and it works, we just don't know about the Laravel framework. We appreciate the response.
Guidelines
Beta Was this translation helpful? Give feedback.
All reactions