I have a set of data in DB and I am sending it to my Android App using an API function. I have written this in PHP. I want to sort JSON array in alphabetical order and then send it in JSON array format. Here is the code I have, I am not sure how or where to sort this
Fetch image variable and display on input file
I am trying to update an image and other data in a database, but when I update only text data, the image value becomes null or empty. This a controller When I input only the title, left out the image, and tried to dump using dd($image);, I got a null value. When updating the image, it’s getting updated …
Best way to securely transfer user to different URL while maintaining their ‘logged in’ status
In the latest version of our SAAS product, we are designing it to allow our customers to deploy multiple instances of the software. We require the sign up and login to be tightly integrated into the primary domain – the “sells the product to new customers” website PrimaryDomain.com which fea…
Generate markup based on multidimensional array
I have the following multidimensional array: I’m trying to loop through the array and create cards with the above. Here’s how I’m looping through the array: The above loop renders out (for one item in the array): As you can see, it’s generating a separate productCard for each key. The …
Difficulty to understand PHP POST to REST API – mixed array and objects
I’m trying to POST data to a REST API. On Postman I can POST with success, the JSON body is: My problem is on addresses billing. I don’t know how to create the object/array correctly so the API accept it. I’m build the parameters on PHO like bellow: I get an error: “missing_entity R…
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 fu…
Laravel & Livewire: How to execute a javascript function when the component changes?
I’m using Laravel 8 and Livewire. I have an application that shows items objects from a table. When you click on an item, it displays the item details to the right. This works great, since the show() method in the component will do anything it does, binding variables, and such… Now, in the details…
What exactly is the difference between an anonymous function and a static anonymous function in PHP?
Basically the purpose of the static keyword is totally clear to me, the PHP docs only explain the purpose of the keyword in the context of classes. I noticed one of my IDE plugins suggesting me that I should declare many of my callback functions as static. Without static: With static: For the result it does n…
Unicode JSON in Laravel blade for use in React, generating a JSON.parse problem
I have a json object in DB: In the Laravel controller, I send the data to the view: In the Laravel Blade, I attach the data in a div: In React I get the data and save in oldData variable: The problem is that I’m getting a JSON.parse error in React because that JSON print in the Laravel view DOM
Typo 8.7 / External Import – Error when importing with external import in CLI in custom extbase extension
I’ve been working on an extension that import a JSON, make a PHP array of what is needed and import it with external_import. This is meant to be a command that will be run with a Cronjob. At the …