I’ve just started work on an old CI project with a lot of old code. The application works fine on the server, but when I pull it to my local environment (it’s also in a github repository), I get the “…
Tag: php
“SplFileInfo::getSize(): stat failed” exception on Laravel 6.0 when doing file upload
I’m using Laravel 6.0 to build a simple image upload system. But for some odd reason, I keep encountering a “SplFileInfo::getSize(): stat failed” exception even though the image is successfully …
Multiple many to many polymorphic relationship problem in Laravel
So I have been working on a project where 2 types of users register. 1. Company 2. Distributor I have created modules for both and they both have separate authentication modules created using …
PHP Array Group by same values and SUM
I’m trying to group by array with same value and key. I have this array input in which i group it by employee no using the function below 0 => array:7 [▼ “employee_no” => “04052018” …
How to set a cookie with the secure flag in PHP?
I want to set the httponly and secure flag true in my code but when i am trying to set that cookie. In that case cookie is not created and am unable to login to site. ini_set(‘session.cookie_httponly’…
Mysql – how to do this sql
I have a “reviews” table with N records with 3 fields. Field ID, field name and score field. What I am trying to do is a query that returns me a grouping by the “score” field but with values …
Codeigniter local host redirects to live server
I downloaded the source code of a website. The website is live and working. I wanted to make some changes offline to test them first but when I go to localhost on my browser, I get redirected to live …
enable/disable generated input by array with relevant checkbox jQuery
How can I enable input field generated in result of a loop from array along with checkbox. I trying to disable the generated input fields and enable the one only when particular corresponding checkbox …
Laravel is returning objects with key:value instead of array of objects
I am trying to return Json response as an array of objects. But instead I got response as object of objects. I have condition_question table where I save question_id and condition_id. I want to retrieve all questions which contains particular condition id. And sort them by answers_number. I am new to Laravel,…
Doctrine QueryBuilder – CASE WHEN
I have a question about case when in doctrine. The problem with this is when uim.isProfileImage is 1 for a user, that returns that row and every other row in user_image table for that user. What I …