Skip to content

Tag: php

Magento 2 Attribute Not Show In Navigation

I have a problem when applying magento 2.1.9 to my project. My attribute is ab_size I have created that attribute with code blow. With config in the backend. Enable filter (with result) done Category Is Anchor done Reindex done Enable Category flat done Enable Product flat done Reindex all data done Clear cac…

PhpStorm unable to recognize the Php File

I have a PHP trait file : appLibsomeTrait.php Even though it is a PHP file (with .php extension), PHPStorm is unable to recognize it as a valid PHP file. The editor is not doing syntax highlighting for PHP code inside this file and it is pretty much displayed as normal text file. I am trying to use this file …

Laravel: Count number of rows in a relationship

I have the following relationship: A venue has many offers A offer has many orders I have the following Eloquent model to represent this: I want to determine the total number of orders for venues with location_id = 5 using Laravel’s Eloquent model. The only way I managed to do this is as follows: Howeve…

Calculating The Percentage Change Between Two Numbers

Looking for some clarification on below code for calculating the percentage change between two different number of which the original could be a greater or smaller number. So will this code work for showing either a increase + or a decrease – change? Thanks. Answer Find difference and then count percent…

PHP How to Remove/Replace Unknown question mark diamond characters

I am using PHP to access data on old machines and output them. Putty shows: ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒NONE. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ Its the weird formatting in a attempt to show data in a more clean way PHP …

Changes to page are not saved (on page reload)

When im logged in i can see the “Remove Stone” button and when i click it, it goes away but when i reload the page it comes back. Any help? Thanks a bunch!Im also loading this into the html page with a seperate php file using this: Also if anyone has a better solution on what to do, im all

Laravel : How to add days to datetime field?

How to add days to datetime field in Laravel? For example, there is a updated_at field in articles table: I want to add 30 days to updated_at field. In Carbon, it could be done like this: But how to do it in above example? Answer Since updated_at and created_at fields are automatically cast to an instance of …

Checking duplicated data in Laravel

This code work as send to inn_db table from ext_db. but it cannot check if the data is the same or different in inn_db. So there posited same values in inn_db. How could I add that job?. Laravel-5.4, MySQL, InnoDB. Finally, I got the answer as below code with connect view when after discussion. Thanks to @Pra…