Can anyone suggest some alternative solution for this problem. I’ve made a popup form which i use css and javascript to trigger the display to none or flex every time i click into a specific button which is great. But this method seems to not work on a table as you can see below i’ve done a simple…
Target index of array
I’m trying to target the index of my array. For some reason my array turns out really weird. Now I get the results I need. But I need the name of each index too. Results: var export – $name: var_export – $mednames: var_export – $cnt: var_export – $c: Now the problem here is that …
How to test create model service?
I decided to create CreateClassroomService to separte logic in my controller method. I am trying to test this service as part of learning unit testing, but I don’t know how. I don’t know how to mock the classroom object to control what the method should return. Does this mean that creating this se…
Rendering conditional HTML elements with PHP
I’m trying to learn PHP to solve an Assesment challenge, where I have to build a Product List & Add Product pages. Reading here and there, watching some tutorials I was able to develop this code so far: Index.php: Thing is, inputs for DVD Size, BOOK Weight and Forniture dimensions ( H, W & L ) s…
Fatal error when using foreach on 3rd array
I’m getting an error when trying to use foreach on 3rd array My goal is to get those data above and expect it to loop until its last data using this code: It returns this error Here is the line 25 Error on line 25 Am I missing something? By the way I’m working on a proxy dashboard for a
Subtract tax from a price with tax in OpenCart?
How do I subtract all taxes from a price with tax in OpenCart? In the example below I use the default “Taxable goods” tax setting from OpenCart, which is 20% VAT + $2,00 Eco-Tax. This returns an incorrect value of $14,64 because it calculates the tax on $number (20,80), which already is a price wi…
CSRF Token Mismatch with Laravel API using Digital Ocean Load Balancer with Sticky Session
I am working on a project in Laravel 8 which I am now testing the deployment on production servers. I have set up 2 Digital Ocean Droplets that are behind a load balancer with Sticky Sessions enabled. I am attempting to login via a SPA app with a separate Laravel API so the middleware is configured for the ap…
Is there any way to find a specific pixel area that is surrounded by a black border with PHP and Imagick?
I’ve been trying to use Imagick to turn PDF files in my PHP application into PNGs so that I can get Tesseract OCR’s PHP library to scan only handwritten text in the documents. The handwritten text areas are surrounded by a black border in the documents, and there’s a chance that they could b…
Sort By date in hasMany relation first record for Laravel project [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 10 months ago. Improve this question I have a courses table and every course has many sessions, So I need to sort courses by th…
fputcsv() problem. Textarea isn’t saved in one column
Today, I found my limit in data operations knowledge. I can successfully save input fields as well as textareas by doing this: Later on, I can retrieve the data and store it in array by using explode()… or so have I thought! The problem is in me. I like BIG textareas. I am currently making a forum page …