With Lumen 8 I have : Model : Store Controller : StoreController Repository : StoreRepository I can get my Store without any problem and get the json below : I would like to get open/close time of the Store. In my model I have a array (for test) and I can show it like that : And get this result
Foreach does not return all values
I have a foreach but it only returns the last value and not all the values, what is the problem? my array My code: Currently it only returns the last value I need you to return the following (example) If it is not clear I will try to improve it Answer If we consider your data won’t change, and you
If I click on Tab, it doesn’t response. Why?
Problem is I cannot click the Tabs on the website and If i click on Tabs; it show Uncaught Type Error: Cannot set properties of null (setting ‘value’). Is there any way to fix this? Also, I am a beginner and I don’t know how to fix this. Codes are written in PHP and Javascript. Above codes a…
Convert PDF to PNG without transparent background
I use the following code to convert PDF to PNG. As you can see, I use code setImageAlphaChannel(Imagick::ALPHACHANNEL_REMOVE ) to remove the background transparency. But in practice it only works for the last page. Do you think there is a problem with the code? Do you have a better solution with a higher spee…
Undefined class constant ‘PDO::FETCH_DEFAULT’
I’m using PHP FluentPDO, this query works in localhost, but not in webhosting. PHP version is 7.4, FluentPDO: “envms/fluentpdo”: “^2.2”: The error is: Undefined class constant ‘PDO::FETCH_DEFAULT’ Answer PHP version is 7.4 This PHP version is no longer supported. Plea…
Convert flat JSON to nested JSON with PHP
I have a JSON file with a single array and all elements in the same level. Each of the entries has a “level” attribute between 1 and 4. I want to have a nested array in the end which has all level 4 inside the level 3, all level 3 inside the level 2, all level 2 inside the level
Codeigniter form helper setting input class on edit form
I am using ion auth to edit some user data.This is the code This produces the input plus the value but without the input class My first code snippet is an attempt at adding input class and populating the input field. This gives me a conversion error Message: Array to string conversion How should i add form cl…
Jquery – php event happening twice
I’ve got a simple chrome extension that is using Jquery and works on a page on our local network. When that page is loaded jquery reacts to clicks on an element called #site and then calls a php page. This has been working for the last 6 months without issue. Normally the test.php page is run once and l…
how to resolve Redirection in laravel8?
The route is not redirecting the specified route in laravel8. Here is my code that is defined in web.php: After hitting ‘/’, I need to redirect to this route: I was getting an error: How to resolve this? Answer Try this to clear the cache: Refs: https://github.com/laravel/framework/discussions/345…
How to output array with new line separated values using Laravel Storage:put
How to output an each array element in a new line with Laravel Storage:put? I have an array like below that I want to put into a file, array_test.txt, where each element goes on a new line. Using Laravel’s Storage, it goes like Storage:put($fileName, $arrTest); However the output is on a single line. St…