I have setup a webhook from Pipedrive to activate on a deal being updated. I am struggling with the correct way to read the json response in php. I am new to Webhooks so is there another way of reading the response data. This is what I have: In requestbin I am getting a response with all the correct informati…
How do I get the total number of students who are only active
I have two tables that store data for students – the students table and student_session table students table structure student_session table structure Now, I’ve been able to get the total number of students in a class using this query However, there are some students who have been disabled for non…
Transform nested collection in laravel
I have a nested collection that I want to transform, pulling some keys “up a level” and discarding some other keys. Every item in the collection has an allergens property. I need to make each items allergens property, look like I’ve tried the following: But it doesn’t overwrite the all…
Convert Local Excel.xlsx File to Google spreadsheet Google DRIVE API
I am trying to convert a local Excel.xlsx file with all existent design, format and formulas existent in my local Excel file. How can I do that using Google API with PHP? What I was doing but not working was : But that is not working. How should I correct? Answer I believe your goal as follows. You want to
How to give id to auto generated element automatically
I want to make a dropdownlist that contains something from my database, all going well until I need to give each of the option unique id
<select id="…
Add new option to the select list without reloading the page – MODAL
I’m trying to append a new option in the select list without refreshing the page once the user added a new option through the bootstrap modal I able to achieve it but there is one problem I’m facing. I also need to append the customer_id in the value attribute of the option tag Select Tag Ajax cal…
WHERE LIKE searching in Eloquent with and without spacing
We’ve made a search system on our website, with a brands table being made. There are some brands that have spaces in their names and some that don’t. We have for example “Turtle Wax” What …
How to calculate balance when the records I want to show in desc order?
I want to to show the recently created amount at the top but also I want to show the balance column, the balance column will add or subtract the amount from the record Controller Blade The problem with this is it starts adding from top, which I don’t want. I want it starts adding from bottom Expected re…
With an HTML form, how can I start debugging the action PHP script with proper GET/POST data? (using PhpStorm and XAMPP)
I’m using PhpStorm 2021.1.3 as an IDE with XAMPP as a PHP7.4 engine. I have installed Xdebug 2.9.2, and it works properly since I can start the debugger on specific PHP scripts. My issue is that I …
SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint in laravel 8
hi i am trying to make category and then subcategory so if a category is deleted subcategory would also be deleted here what i have done so far created a model called category also created a subcategory model run the migration for the category in my subcategories migration i have defined the when i try to mig…