I am trying search functionality through API. I am getting the response with pagination details for the first time but to load more results next_page_url is giving no results GET http://127.0.0.1:8000/api/search?keyword=cityname&minPrice=0&maxPrice=0&bed=any&propertyType=RESEDENTIAL I am retuning the results after some very basic filters Response I am getting is To load more results I am sending a get request to ‘next_page_url’ GET http://127.0.0.1:8000/api/search?page=2
Tag: laravel
The “PUT method is not supported for this route” error comes up after jquery ajax update
I update the database with jquery ajax and print “success/failure” with alert according to the return value. The product update is successful, but the message “failed” appears on the screen and I get the error “The PUT method is not supported for this route”. My jquery: url: coming here by route: Answer Change the method to POST. Considering that csrf
Nested comment system runs too many queries ( laravel & livewire )
I’ve built a nested comment system and it works fine, but I have a problem. when I want to show the comments, it runs too many queries. for example if I have 10 comments and two replies each, laravel debugger shows 40+ queries, and I want to reduce them, here is my code : Query Relationship in Post.php Model Comments
nginx – cURL Error: getaddrinfo() thread failed to start
I’m running a WooCommerce shop and have a Laravel system that retrieves data from our ERP system. This part works just fine. The Laravel system compares differences in products and push out all changes to WooCommerce (product updates and so on). When I look at the log, many of these API request replies with: “cURL Error: getaddrinfo() thread failed to
Laravel Relationships with multiple eloquent
Looks like I need some help with the Relationships part.For example, more than one address record of a user is kept in the database. I can’t view the address part, I think I have a problem with eloquent, but I’m not sure. Following my code: user Table adress Table UserModel AdressModel UserController user_migration adres_migration Answer 1 User having multiple addresse,
Laravel 7 – Edit and update value of checkbox in form
I want to uncheck / check the checkbox for ‘active’ users based on the value set in the form. In MySQL database, I added an ‘active’ column of type ‘tinyint (1)’ in table ‘users’. I have a form to edit different values of the users, like name, email, etc. When I submit the form, everything updates fine except the checkbox,
how to hide results from database until the seacrh is complete in Laravel?
i am making a search for the website so the user can search for results from database everything is working fine but how can i hide results until the user complete the search? this is the controller: and here is the view: so my problem is the view is showing all the results before the user search and i want
Laravel. CarbonPeriod. All “unical” months between two dates
How to make a period with all months between two random dates? I tried: but it doesn’t include January. I also tried to use floor(): but it includes February that don’t even need. How to get pure “unical” months between two dates using CarbonPeriod? For example: start_date: 2021-11-17 23:59:59 & end_date: 2022-01-10 00:00:00 -> 11, 12, 01 Also: start_date: 2021-11-17
Error on input validation even though input exists
I have an application where an user can change his name via a pop-up. This is the method that handles the name change: This is the blade file with the modal: The issue is when I have the required in the request validation I always get the error, when I delete the required everything works perfectly. I need it because
When I pass string variables to controller in laravel via ajax, It doesn’t show me proper data
This is my Ajax Query This is y Controller And this is the response I get, butI actually want the proper string value that I passed through ajax Answer actually, your script shows proper data what you asking for here your URL looks something like this. because you sending a string instead of a value what you need to do