Responsive iFrames with jQuery

iframe {
  max-width: 100%;
}
function adjustIframes()
{
  $('iframe').each(function(){
    var
    $this       = $(this),
    proportion  = $this.data( 'proportion' ),
    w           = $this.attr('width'),
    actual_w    = $this.width();
    
    if ( ! proportion )
    {
        proportion = $this.attr('height') / w;
        $this.data( 'proportion', proportion );
    }
  
    if ( actual_w != w )
    {
        $this.css( 'height', Math.round( actual_w * proportion ) + 'px' );
    }
  });
}
$(window).on('resize load',adjustIframes);

From: https://gist.github.com/aarongustafson/1313517

暫時性排除 laravel 在 php7.2 上產生的 count() 錯誤

Disable warning in error_reporting and edit handleError function to not throw error.

vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:56

public function handleError($level, $message, $file = '', $line = 0, $context = [])
{
    if (error_reporting() & $level) {
        if (strpos($message, 'Parameter must be an array or an object that implements Countable') !== false)
        {
            return;
        }
        throw new ErrorException($message, 0, $level, $file, $line);
    }
}