Daily Articles: 06 Mar, 2020

Laravel How to pass parameter to Accessor method in model via where condition while query building?

I have a Accessor method in Collection Model getSizesAttribute, which returns array of available sizes eg: [‘S’,’L’], Now I need to get Models with have size ‘S’. like: $collections = $collections->where(‘sizes’,’S’); But sizes is array, could I manipulate this anyhow so that I could check returns only if sizes have…

Read More

March 6th, 2020 Laravel, PHP, SolveIt, Tutorials

List files in directory in Codeigniter a php framework

You can use directory helper of codeigniter. To load helper use $this->load->helper(‘directory’); and use directory_map() function to read the directory path specified in the first parameter and builds an array representation of it and all its contained files. Example: $map = directory_map(‘./mydirectory/’); Note: Paths are almost always relative to your…

Read More

March 6th, 2020 Codeigniter, Interview, PHP, SolveIt, Tutorials

Solved – WordPress Mixed Content Error

I have Multisite wordpress environment and also have SSL enabled for the admin section. But I get lots of “Mixed Content” errors on the admin. As a result many scripts and style sheets in the admin are broken . “https://example.com/wp-includes/js/thickbox/loadingAnimation.gif” Blocked loading mixed active content “https://example.com/wp-content/plugins/capsman/framework/styles/admin.css?ver=1.1” Blocked loading mixed active…

Read More

March 6th, 2020 PHP, SEO, SolveIt, Tutorials, Web Design, Wordpress