I am looking for optimum way to add where clause in Laravel query when there are multiple filters(5+ filters) only if filter values are not null. Right now I am having 6 filters on report on front end which will send input to api. below is a pseudocode which i want to achive. I know the simple solution using combination
Tag: laravel-7
How to get last record of duplicate data using group by in Laravel SQL
I want to retrieve last record of multiple row of same id using GroupBy in my laravel project. table purchases query in laravel controller output But Only id no 3 will be the output cause only id no 3 purchases id has due amount. How to solve this? Anybody Help please? Answer Looking at your requirement, you can add a
Error 401 after successful login to Laravel using jwt
In my Laravel project, I use jwt for user authentication.I successfully login and receive the token. I send the token with the Barear prefix in the header but I get a 401 error.Meanwhile, my project works well on localhost, but it has this problem on cpanel hosts.My codes are below in config/auth.php and in configjwt.php ]; my web route: my
Serialize form validation Laravel 8
could not validate an array of input in laravel 8. from the frontside I have gotten the serialized form data which was successfully accessible from the backend. what I want is to validate the form inside the update function before I update the data when the user changes. what I have tried on the validation function is below looking recommendation
Laravel 7 previous and next records with alphabetical order
In my edit form, I want to add a button to save and edit the following user. I am trying that the “next” button takes me to the next record in alphabetical order. I have only managed to order by ID Answer You need to use the rank function of mysql and raw query For previous record For next record
How to Keep a Simple PHP application Inside a Laravel Application? [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last year. The community reviewed whether to reopen this question last year and left it closed: Original close reason(s) were not resolved Improve this question I have a Laravel Application hosted
check in blade if exists variable in @include
I´m developping a system with laravel 7.4 and i need check if one variable that i´m sending from my controller exists in my blade. If exists, include it: I have this code in my controller: this return profile image or system image but it´s possible that this images don´t exists and i need check before, because i have error in
Laravel, how to display Values in DB with just given IDs?
im trying to get 5 data from DB with their ID ? HTML Route Controller – im Trying to get Just 1 ID and its not Working I want to show 5 Offers from Offers Table, with given 5 ID in HTML Form ? How can i do this in Laravel ? Answer You never execute your query… where() is
Insert a Json object in MongoDB from Laravel 7
I need upload a image to Google storage and insert the below JSON object with the gcs image path in MongoDB. The image is successfully getting uploaded in GCS, but I am not able to get the image url of the image and also not able to update the path in mongoDB. JSON object format Can anyone help me to
Laravel doubles the route when navigating between navbar links
I have a problem with laravel routes. I have a navbar with the urls /products and /employee. I manage to switch between perfectly perfectly without giving error. However, when I access the link /products/new and from there I try to go back to /products or go to /employees through the navbar, the link is /products/products or /employee/employee. How do I