Skip to content
Advertisement

cURL to get XML response from an API not working

When I try the url for API endpoint directly in browser, it works and returns XML data, but when I try with cURL, it returns 01 – Unavailable service error, so the issue must be with my cURL code. PHP: Direct URL that works and returns XML data: Answer Rather than trying to send the url parameters within the headers

Laravel spatie roles unique validation for multiple id during update

I created a role “Administrator” but each has one unique guard. I successfully generated them by creating custom function that replicates the web guard to sanctum. Or vice-versa depending where the role is created (e.g react frontend->sanctum guard), or laravel -> web guard). Roles table My current request validation rule is this: I also tried this, but this won’t work

Attempt to read property id on bool in Laravel

i tried assigning a value to a variable in an if condition I get this error Attempt to read property “room_id” on bool meanwhile $hotel variable is not a boolean Answer Your code can be processed by the compiler as in that case you can see $hotel is a bool result from the && operator. You should add parenthesis to

apt-get command not working on xampp, running windows 11

I’m facing error in wordpress on my local server while trying to edin an image, it says “Image rotation is not supported by your web host.” I have a Windows 11 64-bit PC that runs a XAMPP. I need to install a few things on this Apache server via command line, so I’m going to the “shell” option from the

Insert data in a different table sql/ php

Could you please help me i have two different tables table tbl_users: table travail: I put idjob as a foreign key .* And I want to insert the value of job in the user table and i don’ know how the following code of “job” section register.php: Users.php: Answer In your register.php, it would be way more practical to have

Post Method only posting last value fetched from database

I am displaying list of items(multiple entries) from database on one page. I am trying to post all those values fetched from the database to another php file to add item to cart. But when I press ‘add to cart’ button for any item in the list, it is only sending last item through POST. I know it is because

Laravel PHP restart interrupted job where left off

I have a problem. I need to write a Laravel application that reads a json file and writes the content to the database. What is important is that the application can be closed (interrupted) at any time and the application needs to continue where it got interrupted. Now the main writing part is working with background jobs and batches like

Is there a better way to check for mandatory child in HasMany in Laravel?

I have a class AdBannerModel with an HasMany relationship to BannerLocalizedContentModel. When validating the model I call the method alterRulesForSaving where i want to check that the given AdBanner has at least the mandatory localizedContents. This is how I handle the check now, looking for suggestions. Answer you can check existence of relation with needed params

Advertisement