I’m using Laravel and trying to send a form via XMLHttpRequest. It works but the request in the controller doesn’t identify it as ajax. The form has a csrf input. I’ve tried several things, right now my code looks like: But Laravel keeps sending a 419 | Page Expired response. Maybe I’m misinterpreting this information, barking at the wrong tree,
Tag: laravel
Laravel 9 html form submit throws 405. Expects PUT, request is GET
I’m trying to create a simple CRUD application with Laravel 9. I’ve run into a problem with HTML forms. I’ve created a page where you can edit data on rabbits existing in my database. My form web.php routes RabbitController.php Before I even hit the controller I get an exception reading: The GET method is not supported for this route. Supported
Laravel Validation – The full name field is required [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 8 months ago. Improve this question
How to improve eloquent nested foreach performance
How can I improve the performance of a query with the following characteristics (this is a simulation to exemplify): In my real case, the foreach returns a lot of data with performance problems; The Waiting (TTFB), that is, the time the browser is waiting for the first byte of a response, takes almost 27s Answer That will result in 3
How to change datatable show entry position
I want to change datatable show entry position in my project by default it is on top left but i want to bottom right. this is my datatable position code: Answer “sDom”: ‘<“top”f>rt<“bottom”pli>’, by this you can change position of dom
Binary image from API, convert and save path
Im receiving a binary image from an API (Line API) After receiving it, I want to save the image in my public folder and save the path in my database. There were several answers on SO that I thought could work like using intervention/image but I could not manage to fix this. Ive also found a comment saying this cant
How to correctly handle laravel form?
I want to correctly handle user store form. I consider which patter will be the most correct/popular. It is repository pattern? Service pattern? Another difficulty: User form: name, email, postal code, city, street. I want to create two models in one form: User and Address. How can I solve it? I throught about: Issues i’m wondering about: UserRequest has data
How to sum an associative array in laravel by there keys?
I have an array which will have an SKU number, it can be repeated so want to sum of that SKU qty at once and insert in DB table. How can i sum the same sku as index 1 and 3 have and remove the 1st index? Answer Using the solution on this Answer here is how to do it:
Laravel can’t connect to AWS S3
I have set up an S3 bucket and created an IAM user with full S3 access permission, and ran composer require league/flysystem-aws-s3-v3. I have also have configured the following in .env: The problem is that I can’t interact with S3 at all from my controller. I’ve tried sending files to S3: I have also manually uploaded an image to S3,
Search data from array of object inside foreach loop
I have 3 array. The first one is array employee, second is array dateRange(Y-m-d), and the third is array attendance The array is like this: Array Employee Array dateRange Array Attendance (both in & out) What I want to do is to get attendance data from array attendance where employee_id is the same as employee_id in array employee. What I’ve