Skip to content
Advertisement

Tag: laravel

Laravel 7 API pagination is not working after first time

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

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,

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

Advertisement